aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/readdir.c
diff options
context:
space:
mode:
authorJeff Layton <jlayton@redhat.com>2010-09-20 16:01:31 -0700
committerSteve French <sfrench@us.ibm.com>2010-09-29 19:04:32 +0000
commitba00ba64cf0895e4c2ac507e56306363dc125a90 (patch)
tree8edcd34f27aa623535fc5d640aa75c6dbb0d7a65 /fs/cifs/readdir.c
parentd3bf5221d3274b5015ad18a55060b074cca8d2f0 (diff)
downloadkernel_samsung_tuna-ba00ba64cf0895e4c2ac507e56306363dc125a90.zip
kernel_samsung_tuna-ba00ba64cf0895e4c2ac507e56306363dc125a90.tar.gz
kernel_samsung_tuna-ba00ba64cf0895e4c2ac507e56306363dc125a90.tar.bz2
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.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/fs/cifs/readdir.c b/fs/cifs/readdir.c
index 6a8b417..d7784a9 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,
&current_entry, &num_to_fill);
if (rc) {