Skip to content

Commit

Permalink
cifs: move cifsFileInfo_put to file.c
Browse files Browse the repository at this point in the history
...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>
  • Loading branch information
Jeff Layton authored and Steve French committed Oct 18, 2010
1 parent 4477288 commit b33879a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
10 changes: 1 addition & 9 deletions fs/cifs/cifsglob.h
Original file line number Diff line number Diff line change
Expand Up @@ -408,15 +408,7 @@ static inline void cifsFileInfo_get(struct cifsFileInfo *cifs_file)
atomic_inc(&cifs_file->count);
}

/* 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)) {
cifs_put_tlink(cifs_file->tlink);
dput(cifs_file->dentry);
kfree(cifs_file);
}
}
void cifsFileInfo_put(struct cifsFileInfo *cifs_file);

/*
* One of these for each file inode
Expand Down
10 changes: 10 additions & 0 deletions fs/cifs/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit b33879a

Please sign in to comment.