diff options
author | Pavel Shilovsky <pshilovsky@samba.org> | 2012-05-25 06:40:22 -0400 |
---|---|---|
committer | Pavel Shilovsky <pshilovsky@samba.org> | 2012-07-24 13:55:04 -0400 |
commit | 68889f269b16a11866f4ec71e8177bdd0c184a3f (patch) | |
tree | 1593220a714a14fbc49502dbfa1b7402a6ab4914 /fs/cifs/connect.c | |
parent | af4281dc22f1eb8a9503b53330ca02f57db68b25 (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/connect.c')
-rw-r--r-- | fs/cifs/connect.c | 31 |
1 files changed, 6 insertions, 25 deletions
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index 80807923a545..34588fe11c57 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c | |||
@@ -3402,30 +3402,6 @@ cifs_negotiate_rsize(struct cifs_tcon *tcon, struct smb_vol *pvolume_info) | |||
3402 | return rsize; | 3402 | return rsize; |
3403 | } | 3403 | } |
3404 | 3404 | ||
3405 | static int | ||
3406 | is_path_accessible(unsigned int xid, struct cifs_tcon *tcon, | ||
3407 | struct cifs_sb_info *cifs_sb, const char *full_path) | ||
3408 | { | ||
3409 | int rc; | ||
3410 | FILE_ALL_INFO *pfile_info; | ||
3411 | |||
3412 | pfile_info = kmalloc(sizeof(FILE_ALL_INFO), GFP_KERNEL); | ||
3413 | if (pfile_info == NULL) | ||
3414 | return -ENOMEM; | ||
3415 | |||
3416 | rc = CIFSSMBQPathInfo(xid, tcon, full_path, pfile_info, | ||
3417 | 0 /* not legacy */, cifs_sb->local_nls, | ||
3418 | cifs_sb->mnt_cifs_flags & | ||
3419 | CIFS_MOUNT_MAP_SPECIAL_CHR); | ||
3420 | |||
3421 | if (rc == -EOPNOTSUPP || rc == -EINVAL) | ||
3422 | rc = SMBQueryInformation(xid, tcon, full_path, pfile_info, | ||
3423 | cifs_sb->local_nls, cifs_sb->mnt_cifs_flags & | ||
3424 | CIFS_MOUNT_MAP_SPECIAL_CHR); | ||
3425 | kfree(pfile_info); | ||
3426 | return rc; | ||
3427 | } | ||
3428 | |||
3429 | static void | 3405 | static void |
3430 | cleanup_volume_info_contents(struct smb_vol *volume_info) | 3406 | cleanup_volume_info_contents(struct smb_vol *volume_info) |
3431 | { | 3407 | { |
@@ -3703,13 +3679,18 @@ remote_path_check: | |||
3703 | 3679 | ||
3704 | /* check if a whole path is not remote */ | 3680 | /* check if a whole path is not remote */ |
3705 | if (!rc && tcon) { | 3681 | if (!rc && tcon) { |
3682 | if (!server->ops->is_path_accessible) { | ||
3683 | rc = -ENOSYS; | ||
3684 | goto mount_fail_check; | ||
3685 | } | ||
3706 | /* build_path_to_root works only when we have a valid tcon */ | 3686 | /* build_path_to_root works only when we have a valid tcon */ |
3707 | full_path = cifs_build_path_to_root(volume_info, cifs_sb, tcon); | 3687 | full_path = cifs_build_path_to_root(volume_info, cifs_sb, tcon); |
3708 | if (full_path == NULL) { | 3688 | if (full_path == NULL) { |
3709 | rc = -ENOMEM; | 3689 | rc = -ENOMEM; |
3710 | goto mount_fail_check; | 3690 | goto mount_fail_check; |
3711 | } | 3691 | } |
3712 | rc = is_path_accessible(xid, tcon, cifs_sb, full_path); | 3692 | rc = server->ops->is_path_accessible(xid, tcon, cifs_sb, |
3693 | full_path); | ||
3713 | if (rc != 0 && rc != -EREMOTE) { | 3694 | if (rc != 0 && rc != -EREMOTE) { |
3714 | kfree(full_path); | 3695 | kfree(full_path); |
3715 | goto mount_fail_check; | 3696 | goto mount_fail_check; |