diff options
author | Jeff Layton <jlayton@redhat.com> | 2010-09-20 16:01:31 -0700 |
---|---|---|
committer | Steve French <sfrench@us.ibm.com> | 2010-09-29 19:04:32 +0000 |
commit | ba00ba64cf0895e4c2ac507e56306363dc125a90 (patch) | |
tree | 8edcd34f27aa623535fc5d640aa75c6dbb0d7a65 /fs/cifs/readdir.c | |
parent | d3bf5221d3274b5015ad18a55060b074cca8d2f0 (diff) | |
download | linux-ba00ba64cf0895e4c2ac507e56306363dc125a90.tar.gz linux-ba00ba64cf0895e4c2ac507e56306363dc125a90.tar.bz2 linux-ba00ba64cf0895e4c2ac507e56306363dc125a90.zip |
cifs: make various routines use the cifsFileInfo->tcon pointer
...where it's available and appropriate.
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs/readdir.c')
-rw-r--r-- | fs/cifs/readdir.c | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/fs/cifs/readdir.c b/fs/cifs/readdir.c index 6a8b417babab..d7784a95134f 100644 --- a/fs/cifs/readdir.c +++ b/fs/cifs/readdir.c @@ -228,22 +228,21 @@ static int initiate_cifs_search(const int xid, struct file *file) struct cifs_sb_info *cifs_sb; struct cifsTconInfo *pTcon; - if (file->private_data == NULL) { + cifs_sb = CIFS_SB(file->f_path.dentry->d_sb); + if (cifs_sb == NULL) + return -EINVAL; + + if (file->private_data == NULL) file->private_data = kzalloc(sizeof(struct cifsFileInfo), GFP_KERNEL); - } if (file->private_data == NULL) return -ENOMEM; cifsFile = file->private_data; cifsFile->invalidHandle = true; cifsFile->srch_inf.endOfSearch = false; - - cifs_sb = CIFS_SB(file->f_path.dentry->d_sb); - if (cifs_sb == NULL) - return -EINVAL; - - pTcon = cifs_sb->tcon; + cifsFile->tcon = cifs_sb->tcon; + pTcon = cifsFile->tcon; if (pTcon == NULL) return -EINVAL; @@ -786,9 +785,6 @@ int cifs_readdir(struct file *file, void *direntry, filldir_t filldir) xid = GetXid(); cifs_sb = CIFS_SB(file->f_path.dentry->d_sb); - pTcon = cifs_sb->tcon; - if (pTcon == NULL) - return -EINVAL; switch ((int) file->f_pos) { case 0: @@ -838,6 +834,7 @@ int cifs_readdir(struct file *file, void *direntry, filldir_t filldir) CIFSFindClose(xid, pTcon, cifsFile->netfid); } */ + pTcon = cifsFile->tcon; rc = find_cifs_entry(xid, pTcon, file, ¤t_entry, &num_to_fill); if (rc) { |