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/inode.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/inode.c')
-rw-r--r-- | fs/cifs/inode.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c index aa229692aef1..a39a1c451733 100644 --- a/fs/cifs/inode.c +++ b/fs/cifs/inode.c | |||
@@ -289,7 +289,7 @@ int cifs_get_file_info_unix(struct file *filp) | |||
289 | struct inode *inode = filp->f_path.dentry->d_inode; | 289 | struct inode *inode = filp->f_path.dentry->d_inode; |
290 | struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb); | 290 | struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb); |
291 | struct cifsFileInfo *cfile = filp->private_data; | 291 | struct cifsFileInfo *cfile = filp->private_data; |
292 | struct cifsTconInfo *tcon = cfile->tcon; | 292 | struct cifsTconInfo *tcon = tlink_tcon(cfile->tlink); |
293 | 293 | ||
294 | xid = GetXid(); | 294 | xid = GetXid(); |
295 | rc = CIFSSMBUnixQFileInfo(xid, tcon, cfile->netfid, &find_data); | 295 | rc = CIFSSMBUnixQFileInfo(xid, tcon, cfile->netfid, &find_data); |
@@ -546,7 +546,7 @@ int cifs_get_file_info(struct file *filp) | |||
546 | struct inode *inode = filp->f_path.dentry->d_inode; | 546 | struct inode *inode = filp->f_path.dentry->d_inode; |
547 | struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb); | 547 | struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb); |
548 | struct cifsFileInfo *cfile = filp->private_data; | 548 | struct cifsFileInfo *cfile = filp->private_data; |
549 | struct cifsTconInfo *tcon = cfile->tcon; | 549 | struct cifsTconInfo *tcon = tlink_tcon(cfile->tlink); |
550 | 550 | ||
551 | xid = GetXid(); | 551 | xid = GetXid(); |
552 | rc = CIFSSMBQFileInfo(xid, tcon, cfile->netfid, &find_data); | 552 | rc = CIFSSMBQFileInfo(xid, tcon, cfile->netfid, &find_data); |
@@ -967,7 +967,7 @@ cifs_set_file_info(struct inode *inode, struct iattr *attrs, int xid, | |||
967 | if (open_file) { | 967 | if (open_file) { |
968 | netfid = open_file->netfid; | 968 | netfid = open_file->netfid; |
969 | netpid = open_file->pid; | 969 | netpid = open_file->pid; |
970 | pTcon = open_file->tcon; | 970 | pTcon = tlink_tcon(open_file->tlink); |
971 | goto set_via_filehandle; | 971 | goto set_via_filehandle; |
972 | } | 972 | } |
973 | 973 | ||
@@ -1696,7 +1696,7 @@ int cifs_revalidate_file(struct file *filp) | |||
1696 | if (!cifs_inode_needs_reval(inode)) | 1696 | if (!cifs_inode_needs_reval(inode)) |
1697 | goto check_inval; | 1697 | goto check_inval; |
1698 | 1698 | ||
1699 | if (cfile->tcon->unix_ext) | 1699 | if (tlink_tcon(cfile->tlink)->unix_ext) |
1700 | rc = cifs_get_file_info_unix(filp); | 1700 | rc = cifs_get_file_info_unix(filp); |
1701 | else | 1701 | else |
1702 | rc = cifs_get_file_info(filp); | 1702 | rc = cifs_get_file_info(filp); |
@@ -1817,7 +1817,7 @@ cifs_set_file_size(struct inode *inode, struct iattr *attrs, | |||
1817 | if (open_file) { | 1817 | if (open_file) { |
1818 | __u16 nfid = open_file->netfid; | 1818 | __u16 nfid = open_file->netfid; |
1819 | __u32 npid = open_file->pid; | 1819 | __u32 npid = open_file->pid; |
1820 | pTcon = open_file->tcon; | 1820 | pTcon = tlink_tcon(open_file->tlink); |
1821 | rc = CIFSSMBSetFileSize(xid, pTcon, attrs->ia_size, nfid, | 1821 | rc = CIFSSMBSetFileSize(xid, pTcon, attrs->ia_size, nfid, |
1822 | npid, false); | 1822 | npid, false); |
1823 | cifsFileInfo_put(open_file); | 1823 | cifsFileInfo_put(open_file); |
@@ -1982,7 +1982,7 @@ cifs_setattr_unix(struct dentry *direntry, struct iattr *attrs) | |||
1982 | if (open_file) { | 1982 | if (open_file) { |
1983 | u16 nfid = open_file->netfid; | 1983 | u16 nfid = open_file->netfid; |
1984 | u32 npid = open_file->pid; | 1984 | u32 npid = open_file->pid; |
1985 | pTcon = open_file->tcon; | 1985 | pTcon = tlink_tcon(open_file->tlink); |
1986 | rc = CIFSSMBUnixSetFileInfo(xid, pTcon, args, nfid, npid); | 1986 | rc = CIFSSMBUnixSetFileInfo(xid, pTcon, args, nfid, npid); |
1987 | cifsFileInfo_put(open_file); | 1987 | cifsFileInfo_put(open_file); |
1988 | } else { | 1988 | } else { |