summaryrefslogtreecommitdiffstats
path: root/fs/cifs/file.c
diff options
context:
space:
mode:
authorJeff Layton <jlayton@redhat.com>2010-10-15 15:34:04 -0400
committerSteve French <sfrench@us.ibm.com>2010-10-18 01:32:05 +0000
commitb33879aa834ebe03ced3dca4e3b822bd8894a474 (patch)
tree9475bb683f03180a5fe7909d4182bb5273f5d7a6 /fs/cifs/file.c
parent4477288a103631980750c86547d1fd54bfd2ba7d (diff)
downloadtalos-obmc-linux-b33879aa834ebe03ced3dca4e3b822bd8894a474.tar.gz
talos-obmc-linux-b33879aa834ebe03ced3dca4e3b822bd8894a474.zip
cifs: move cifsFileInfo_put to file.c
...and make it non-inlined in preparation for the move of most of cifs_close to it. Signed-off-by: Jeff Layton <jlayton@redhat.com> Reviewed-by: Suresh Jayaraman <sjayaraman@suse.de> Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs/file.c')
-rw-r--r--fs/cifs/file.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/fs/cifs/file.c b/fs/cifs/file.c
index 26048dc9069a..a3634e43bd4f 100644
--- a/fs/cifs/file.c
+++ b/fs/cifs/file.c
@@ -266,6 +266,16 @@ cifs_new_fileinfo(__u16 fileHandle, struct file *file,
return pCifsFile;
}
+/* Release a reference on the file private data */
+void cifsFileInfo_put(struct cifsFileInfo *cifs_file)
+{
+ if (atomic_dec_and_test(&cifs_file->count)) {
+ cifs_put_tlink(cifs_file->tlink);
+ dput(cifs_file->dentry);
+ kfree(cifs_file);
+ }
+}
+
int cifs_open(struct inode *inode, struct file *file)
{
int rc = -EACCES;
OpenPOWER on IntegriCloud