summaryrefslogtreecommitdiffstats
path: root/fs/cifs/dir.c
diff options
context:
space:
mode:
authorJeff Layton <jlayton@redhat.com>2010-10-11 21:07:18 +0200
committerSteve French <sfrench@us.ibm.com>2010-10-12 20:06:42 +0200
commita5e18bc36e9e05ce0338d370a2ce4290910e43ea (patch)
tree9d8b37c1dd20267c372ff8c98850eeb2f204449b /fs/cifs/dir.c
parentcifs: on multiuser mount, set ownership to current_fsuid/current_fsgid (try #7) (diff)
downloadlinux-a5e18bc36e9e05ce0338d370a2ce4290910e43ea.tar.xz
linux-a5e18bc36e9e05ce0338d370a2ce4290910e43ea.zip
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/dir.c')
-rw-r--r--fs/cifs/dir.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c
index e249b561ce8f..6887c412c61a 100644
--- a/fs/cifs/dir.c
+++ b/fs/cifs/dir.c
@@ -135,6 +135,7 @@ cifs_new_fileinfo(struct inode *newinode, __u16 fileHandle, struct file *file,
struct vfsmount *mnt, struct tcon_link *tlink,
unsigned int oflags, __u32 oplock)
{
+ struct dentry *dentry = file->f_path.dentry;
struct cifsFileInfo *pCifsFile;
struct cifsInodeInfo *pCifsInode;
@@ -145,7 +146,7 @@ cifs_new_fileinfo(struct inode *newinode, __u16 fileHandle, struct file *file,
pCifsFile->netfid = fileHandle;
pCifsFile->pid = current->tgid;
pCifsFile->uid = current_fsuid();
- pCifsFile->pInode = igrab(newinode);
+ pCifsFile->dentry = dget(dentry);
pCifsFile->mnt = mnt;
pCifsFile->pfile = file;
pCifsFile->invalidHandle = false;