diff options
author | Pavel Shilovsky <pshilovsky@samba.org> | 2012-07-13 05:58:14 -0400 |
---|---|---|
committer | Steve French <smfrench@gmail.com> | 2012-07-24 15:12:03 -0400 |
commit | 29e20f9c65fae245d6fd4fce31cc5d01cde3d93f (patch) | |
tree | 3e8410588672f7f0947c4c9bffd2455f855d0b02 /fs/cifs/readdir.c | |
parent | d60622eb5a23904facf4a4efac60f5bfa810d7d4 (diff) |
CIFS: Make CAP_* checks protocol independent
Since both CIFS and SMB2 use ses->capabilities (server->capabilities)
field but flags are different we should make such checks protocol
independent.
Reviewed-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Pavel Shilovsky <pshilovsky@samba.org>
Signed-off-by: Steve French <smfrench@gmail.com>
Diffstat (limited to 'fs/cifs/readdir.c')
-rw-r--r-- | fs/cifs/readdir.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/fs/cifs/readdir.c b/fs/cifs/readdir.c index da30d96a7495..d87f82678bc7 100644 --- a/fs/cifs/readdir.c +++ b/fs/cifs/readdir.c | |||
@@ -228,7 +228,7 @@ static int initiate_cifs_search(const unsigned int xid, struct file *file) | |||
228 | struct cifsFileInfo *cifsFile; | 228 | struct cifsFileInfo *cifsFile; |
229 | struct cifs_sb_info *cifs_sb = CIFS_SB(file->f_path.dentry->d_sb); | 229 | struct cifs_sb_info *cifs_sb = CIFS_SB(file->f_path.dentry->d_sb); |
230 | struct tcon_link *tlink = NULL; | 230 | struct tcon_link *tlink = NULL; |
231 | struct cifs_tcon *pTcon; | 231 | struct cifs_tcon *tcon; |
232 | 232 | ||
233 | if (file->private_data == NULL) { | 233 | if (file->private_data == NULL) { |
234 | tlink = cifs_sb_tlink(cifs_sb); | 234 | tlink = cifs_sb_tlink(cifs_sb); |
@@ -242,10 +242,10 @@ static int initiate_cifs_search(const unsigned int xid, struct file *file) | |||
242 | } | 242 | } |
243 | file->private_data = cifsFile; | 243 | file->private_data = cifsFile; |
244 | cifsFile->tlink = cifs_get_tlink(tlink); | 244 | cifsFile->tlink = cifs_get_tlink(tlink); |
245 | pTcon = tlink_tcon(tlink); | 245 | tcon = tlink_tcon(tlink); |
246 | } else { | 246 | } else { |
247 | cifsFile = file->private_data; | 247 | cifsFile = file->private_data; |
248 | pTcon = tlink_tcon(cifsFile->tlink); | 248 | tcon = tlink_tcon(cifsFile->tlink); |
249 | } | 249 | } |
250 | 250 | ||
251 | cifsFile->invalidHandle = true; | 251 | cifsFile->invalidHandle = true; |
@@ -262,11 +262,11 @@ static int initiate_cifs_search(const unsigned int xid, struct file *file) | |||
262 | ffirst_retry: | 262 | ffirst_retry: |
263 | /* test for Unix extensions */ | 263 | /* test for Unix extensions */ |
264 | /* but now check for them on the share/mount not on the SMB session */ | 264 | /* but now check for them on the share/mount not on the SMB session */ |
265 | /* if (pTcon->ses->capabilities & CAP_UNIX) { */ | 265 | /* if (cap_unix(tcon->ses) { */ |
266 | if (pTcon->unix_ext) | 266 | if (tcon->unix_ext) |
267 | cifsFile->srch_inf.info_level = SMB_FIND_FILE_UNIX; | 267 | cifsFile->srch_inf.info_level = SMB_FIND_FILE_UNIX; |
268 | else if ((pTcon->ses->capabilities & | 268 | else if ((tcon->ses->capabilities & |
269 | (CAP_NT_SMBS | CAP_NT_FIND)) == 0) { | 269 | tcon->ses->server->vals->cap_nt_find) == 0) { |
270 | cifsFile->srch_inf.info_level = SMB_FIND_FILE_INFO_STANDARD; | 270 | cifsFile->srch_inf.info_level = SMB_FIND_FILE_INFO_STANDARD; |
271 | } else if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SERVER_INUM) { | 271 | } else if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SERVER_INUM) { |
272 | cifsFile->srch_inf.info_level = SMB_FIND_FILE_ID_FULL_DIR_INFO; | 272 | cifsFile->srch_inf.info_level = SMB_FIND_FILE_ID_FULL_DIR_INFO; |
@@ -278,7 +278,7 @@ ffirst_retry: | |||
278 | if (backup_cred(cifs_sb)) | 278 | if (backup_cred(cifs_sb)) |
279 | search_flags |= CIFS_SEARCH_BACKUP_SEARCH; | 279 | search_flags |= CIFS_SEARCH_BACKUP_SEARCH; |
280 | 280 | ||
281 | rc = CIFSFindFirst(xid, pTcon, full_path, cifs_sb->local_nls, | 281 | rc = CIFSFindFirst(xid, tcon, full_path, cifs_sb->local_nls, |
282 | &cifsFile->netfid, search_flags, &cifsFile->srch_inf, | 282 | &cifsFile->netfid, search_flags, &cifsFile->srch_inf, |
283 | cifs_sb->mnt_cifs_flags & | 283 | cifs_sb->mnt_cifs_flags & |
284 | CIFS_MOUNT_MAP_SPECIAL_CHR, CIFS_DIR_SEP(cifs_sb)); | 284 | CIFS_MOUNT_MAP_SPECIAL_CHR, CIFS_DIR_SEP(cifs_sb)); |