summaryrefslogtreecommitdiffstats
path: root/fs/cifs/dir.c
diff options
context:
space:
mode:
authorJeff Layton <jlayton@redhat.com>2010-09-29 19:51:11 -0400
committerSteve French <sfrench@us.ibm.com>2010-10-06 16:12:49 +0000
commit13cfb7334eb6fd0fc06da5589aea1e947791f1d6 (patch)
tree56d884f6a5dbcf8b259247fdad55c9158bd4d865 /fs/cifs/dir.c
parent7ffec372458d163492e56e663a1b3a2d7be0a0a2 (diff)
downloadlinux-13cfb7334eb6fd0fc06da5589aea1e947791f1d6.tar.gz
linux-13cfb7334eb6fd0fc06da5589aea1e947791f1d6.tar.bz2
linux-13cfb7334eb6fd0fc06da5589aea1e947791f1d6.zip
cifs: have cifsFileInfo hold a reference to a tlink rather than tcon pointer
cifsFileInfo needs a pointer to a tcon, but it doesn't currently hold a reference to it. Change it to keep a pointer to a tcon_link instead and hold a reference to it. That will keep the tcon from being freed until the file is closed. Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs/dir.c')
-rw-r--r--fs/cifs/dir.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c
index bb3ea06ca6f4..5adf47f28fed 100644
--- a/fs/cifs/dir.c
+++ b/fs/cifs/dir.c
@@ -132,7 +132,7 @@ cifs_bp_rename_retry:
struct cifsFileInfo *
cifs_new_fileinfo(struct inode *newinode, __u16 fileHandle, struct file *file,
- struct vfsmount *mnt, struct cifsTconInfo *tcon,
+ struct vfsmount *mnt, struct tcon_link *tlink,
unsigned int oflags, __u32 oplock)
{
struct cifsFileInfo *pCifsFile;
@@ -149,7 +149,7 @@ cifs_new_fileinfo(struct inode *newinode, __u16 fileHandle, struct file *file,
pCifsFile->pfile = file;
pCifsFile->invalidHandle = false;
pCifsFile->closePend = false;
- pCifsFile->tcon = tcon;
+ pCifsFile->tlink = cifs_get_tlink(tlink);
mutex_init(&pCifsFile->fh_mutex);
mutex_init(&pCifsFile->lock_mutex);
INIT_LIST_HEAD(&pCifsFile->llist);
@@ -157,7 +157,7 @@ cifs_new_fileinfo(struct inode *newinode, __u16 fileHandle, struct file *file,
INIT_WORK(&pCifsFile->oplock_break, cifs_oplock_break);
write_lock(&GlobalSMBSeslock);
- list_add(&pCifsFile->tlist, &tcon->openFileList);
+ list_add(&pCifsFile->tlist, &(tlink_tcon(tlink)->openFileList));
pCifsInode = CIFS_I(newinode);
if (pCifsInode) {
/* if readable file instance put first in list*/
@@ -483,7 +483,7 @@ cifs_create_set_dentry:
}
pfile_info = cifs_new_fileinfo(newinode, fileHandle, filp,
- nd->path.mnt, tcon, oflags,
+ nd->path.mnt, tlink, oflags,
oplock);
if (pfile_info == NULL) {
fput(filp);
@@ -758,7 +758,7 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry,
}
cfile = cifs_new_fileinfo(newInode, fileHandle, filp,
- nd->path.mnt, pTcon,
+ nd->path.mnt, tlink,
nd->intent.open.flags,
oplock);
if (cfile == NULL) {