aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/smb1ops.c
diff options
context:
space:
mode:
authorPavel Shilovsky <pshilovsky@samba.org>2012-05-25 06:40:22 -0400
committerPavel Shilovsky <pshilovsky@samba.org>2012-07-24 13:55:04 -0400
commit68889f269b16a11866f4ec71e8177bdd0c184a3f (patch)
tree1593220a714a14fbc49502dbfa1b7402a6ab4914 /fs/cifs/smb1ops.c
parentaf4281dc22f1eb8a9503b53330ca02f57db68b25 (diff)
CIFS: Move is_path_accessible to ops struct
Signed-off-by: Pavel Shilovsky <pshilovsky@samba.org> Signed-off-by: Steve French <smfrench@gmail.com>
Diffstat (limited to 'fs/cifs/smb1ops.c')
-rw-r--r--fs/cifs/smb1ops.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/fs/cifs/smb1ops.c b/fs/cifs/smb1ops.c
index 96eb06ff9dd1..43f3881ad3b8 100644
--- a/fs/cifs/smb1ops.c
+++ b/fs/cifs/smb1ops.c
@@ -417,6 +417,30 @@ cifs_qfs_tcon(const unsigned int xid, struct cifs_tcon *tcon)
417 CIFSSMBQFSAttributeInfo(xid, tcon); 417 CIFSSMBQFSAttributeInfo(xid, tcon);
418} 418}
419 419
420static int
421cifs_is_path_accessible(const unsigned int xid, struct cifs_tcon *tcon,
422 struct cifs_sb_info *cifs_sb, const char *full_path)
423{
424 int rc;
425 FILE_ALL_INFO *file_info;
426
427 file_info = kmalloc(sizeof(FILE_ALL_INFO), GFP_KERNEL);
428 if (file_info == NULL)
429 return -ENOMEM;
430
431 rc = CIFSSMBQPathInfo(xid, tcon, full_path, file_info,
432 0 /* not legacy */, cifs_sb->local_nls,
433 cifs_sb->mnt_cifs_flags &
434 CIFS_MOUNT_MAP_SPECIAL_CHR);
435
436 if (rc == -EOPNOTSUPP || rc == -EINVAL)
437 rc = SMBQueryInformation(xid, tcon, full_path, file_info,
438 cifs_sb->local_nls, cifs_sb->mnt_cifs_flags &
439 CIFS_MOUNT_MAP_SPECIAL_CHR);
440 kfree(file_info);
441 return rc;
442}
443
420struct smb_version_operations smb1_operations = { 444struct smb_version_operations smb1_operations = {
421 .send_cancel = send_nt_cancel, 445 .send_cancel = send_nt_cancel,
422 .compare_fids = cifs_compare_fids, 446 .compare_fids = cifs_compare_fids,
@@ -443,6 +467,7 @@ struct smb_version_operations smb1_operations = {
443 .tree_disconnect = CIFSSMBTDis, 467 .tree_disconnect = CIFSSMBTDis,
444 .get_dfs_refer = CIFSGetDFSRefer, 468 .get_dfs_refer = CIFSGetDFSRefer,
445 .qfs_tcon = cifs_qfs_tcon, 469 .qfs_tcon = cifs_qfs_tcon,
470 .is_path_accessible = cifs_is_path_accessible,
446}; 471};
447 472
448struct smb_version_values smb1_values = { 473struct smb_version_values smb1_values = {