diff options
author | Jeff Layton <jlayton@redhat.com> | 2010-09-29 19:51:11 -0400 |
---|---|---|
committer | Steve French <sfrench@us.ibm.com> | 2010-10-06 12:12:49 -0400 |
commit | 13cfb7334eb6fd0fc06da5589aea1e947791f1d6 (patch) | |
tree | 56d884f6a5dbcf8b259247fdad55c9158bd4d865 /fs/cifs/dir.c | |
parent | 7ffec372458d163492e56e663a1b3a2d7be0a0a2 (diff) |
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.c | 10 |
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: | |||
132 | 132 | ||
133 | struct cifsFileInfo * | 133 | struct cifsFileInfo * |
134 | cifs_new_fileinfo(struct inode *newinode, __u16 fileHandle, struct file *file, | 134 | cifs_new_fileinfo(struct inode *newinode, __u16 fileHandle, struct file *file, |
135 | struct vfsmount *mnt, struct cifsTconInfo *tcon, | 135 | struct vfsmount *mnt, struct tcon_link *tlink, |
136 | unsigned int oflags, __u32 oplock) | 136 | unsigned int oflags, __u32 oplock) |
137 | { | 137 | { |
138 | struct cifsFileInfo *pCifsFile; | 138 | struct cifsFileInfo *pCifsFile; |
@@ -149,7 +149,7 @@ cifs_new_fileinfo(struct inode *newinode, __u16 fileHandle, struct file *file, | |||
149 | pCifsFile->pfile = file; | 149 | pCifsFile->pfile = file; |
150 | pCifsFile->invalidHandle = false; | 150 | pCifsFile->invalidHandle = false; |
151 | pCifsFile->closePend = false; | 151 | pCifsFile->closePend = false; |
152 | pCifsFile->tcon = tcon; | 152 | pCifsFile->tlink = cifs_get_tlink(tlink); |
153 | mutex_init(&pCifsFile->fh_mutex); | 153 | mutex_init(&pCifsFile->fh_mutex); |
154 | mutex_init(&pCifsFile->lock_mutex); | 154 | mutex_init(&pCifsFile->lock_mutex); |
155 | INIT_LIST_HEAD(&pCifsFile->llist); | 155 | INIT_LIST_HEAD(&pCifsFile->llist); |
@@ -157,7 +157,7 @@ cifs_new_fileinfo(struct inode *newinode, __u16 fileHandle, struct file *file, | |||
157 | INIT_WORK(&pCifsFile->oplock_break, cifs_oplock_break); | 157 | INIT_WORK(&pCifsFile->oplock_break, cifs_oplock_break); |
158 | 158 | ||
159 | write_lock(&GlobalSMBSeslock); | 159 | write_lock(&GlobalSMBSeslock); |
160 | list_add(&pCifsFile->tlist, &tcon->openFileList); | 160 | list_add(&pCifsFile->tlist, &(tlink_tcon(tlink)->openFileList)); |
161 | pCifsInode = CIFS_I(newinode); | 161 | pCifsInode = CIFS_I(newinode); |
162 | if (pCifsInode) { | 162 | if (pCifsInode) { |
163 | /* if readable file instance put first in list*/ | 163 | /* if readable file instance put first in list*/ |
@@ -483,7 +483,7 @@ cifs_create_set_dentry: | |||
483 | } | 483 | } |
484 | 484 | ||
485 | pfile_info = cifs_new_fileinfo(newinode, fileHandle, filp, | 485 | pfile_info = cifs_new_fileinfo(newinode, fileHandle, filp, |
486 | nd->path.mnt, tcon, oflags, | 486 | nd->path.mnt, tlink, oflags, |
487 | oplock); | 487 | oplock); |
488 | if (pfile_info == NULL) { | 488 | if (pfile_info == NULL) { |
489 | fput(filp); | 489 | fput(filp); |
@@ -758,7 +758,7 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry, | |||
758 | } | 758 | } |
759 | 759 | ||
760 | cfile = cifs_new_fileinfo(newInode, fileHandle, filp, | 760 | cfile = cifs_new_fileinfo(newInode, fileHandle, filp, |
761 | nd->path.mnt, pTcon, | 761 | nd->path.mnt, tlink, |
762 | nd->intent.open.flags, | 762 | nd->intent.open.flags, |
763 | oplock); | 763 | oplock); |
764 | if (cfile == NULL) { | 764 | if (cfile == NULL) { |