diff options
author | Jeff Layton <jlayton@redhat.com> | 2009-09-12 19:54:29 +0400 |
---|---|---|
committer | Steve French <sfrench@us.ibm.com> | 2009-09-15 23:45:25 +0400 |
commit | 48541bd3dd4739b4d574b44ea47660c88d833677 (patch) | |
tree | 5ee6d16b924b8c171e66088c5bb3b1d1720cd29f /fs/cifs/cifsglob.h | |
parent | 058daf4f6795fd23fcca41fe53151cdcbbd263ec (diff) | |
download | linux-48541bd3dd4739b4d574b44ea47660c88d833677.tar.xz |
cifs: have cifsFileInfo hold an extra inode reference
It's possible that this struct will outlive the filp to which it is
attached. If it does and it needs to do some work on the inode, then
it'll need a reference.
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs/cifsglob.h')
-rw-r--r-- | fs/cifs/cifsglob.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h index 9a7527dc977e..c19419a38f62 100644 --- a/fs/cifs/cifsglob.h +++ b/fs/cifs/cifsglob.h @@ -365,8 +365,10 @@ static inline void cifsFileInfo_get(struct cifsFileInfo *cifs_file) /* Release a reference on the file private data */ static inline void cifsFileInfo_put(struct cifsFileInfo *cifs_file) { - if (atomic_dec_and_test(&cifs_file->count)) + if (atomic_dec_and_test(&cifs_file->count)) { + iput(cifs_file->pInode); kfree(cifs_file); + } } /* |