aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/cifsglob.h
diff options
context:
space:
mode:
authorJeff Layton <jlayton@redhat.com>2010-10-11 15:07:18 -0400
committerSteve French <sfrench@us.ibm.com>2010-10-12 18:06:42 +0000
commita5e18bc36e9e05ce0338d370a2ce4290910e43ea (patch)
tree9d8b37c1dd20267c372ff8c98850eeb2f204449b /fs/cifs/cifsglob.h
parent1c456013e96f10915578dc61095d19b4906f64ac (diff)
downloadkernel_samsung_smdk4412-a5e18bc36e9e05ce0338d370a2ce4290910e43ea.zip
kernel_samsung_smdk4412-a5e18bc36e9e05ce0338d370a2ce4290910e43ea.tar.gz
kernel_samsung_smdk4412-a5e18bc36e9e05ce0338d370a2ce4290910e43ea.tar.bz2
cifs: keep dentry reference in cifsFileInfo instead of inode reference
cifsFileInfo is a bit problematic. It contains a reference back to the struct file itself. This makes it difficult for a cifsFileInfo to exist without a corresponding struct file. It would be better instead of the cifsFileInfo just held info pertaining to the open file on the server instead without any back refrences to the struct file. This would allow it to exist after the filp to which it was originally attached was closed. Much of the use of the file pointer in this struct is to get at the dentry. Begin divorcing the cifsFileInfo from the struct file by keeping a reference to the dentry. Since the dentry will have a reference to the inode, we can eliminate the "pInode" field too and convert the igrab/iput to dget/dput. Signed-off-by: Jeff Layton <jlayton@redhat.com> Reviewed-by: Suresh Jayaraman <sjayaraman@suse.de> Acked-by: Dave Kleikamp <shaggy@linux.vnet.ibm.com> Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs/cifsglob.h')
-rw-r--r--fs/cifs/cifsglob.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h
index 4f85dfd..8289e61 100644
--- a/fs/cifs/cifsglob.h
+++ b/fs/cifs/cifsglob.h
@@ -387,7 +387,7 @@ struct cifsFileInfo {
/* BB add lock scope info here if needed */ ;
/* lock scope id (0 if none) */
struct file *pfile; /* needed for writepage */
- struct inode *pInode; /* needed for oplock break */
+ struct dentry *dentry;
struct vfsmount *mnt;
struct tcon_link *tlink;
struct mutex lock_mutex;
@@ -412,7 +412,7 @@ static inline void cifsFileInfo_put(struct cifsFileInfo *cifs_file)
{
if (atomic_dec_and_test(&cifs_file->count)) {
cifs_put_tlink(cifs_file->tlink);
- iput(cifs_file->pInode);
+ dput(cifs_file->dentry);
kfree(cifs_file);
}
}