summaryrefslogtreecommitdiff
path: root/fs/cifs/connect.c
diff options
context:
space:
mode:
authorPavel Shilovsky <pshilovsky@samba.org>2012-05-25 14:40:22 +0400
committerPavel Shilovsky <pshilovsky@samba.org>2012-07-24 21:55:04 +0400
commit68889f269b16a11866f4ec71e8177bdd0c184a3f (patch)
tree1593220a714a14fbc49502dbfa1b7402a6ab4914 /fs/cifs/connect.c
parentaf4281dc22f1eb8a9503b53330ca02f57db68b25 (diff)
downloadlwn-68889f269b16a11866f4ec71e8177bdd0c184a3f.tar.gz
lwn-68889f269b16a11866f4ec71e8177bdd0c184a3f.zip
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.c31
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)
return rsize;
}
-static int
-is_path_accessible(unsigned int xid, struct cifs_tcon *tcon,
- struct cifs_sb_info *cifs_sb, const char *full_path)
-{
- int rc;
- FILE_ALL_INFO *pfile_info;
-
- pfile_info = kmalloc(sizeof(FILE_ALL_INFO), GFP_KERNEL);
- if (pfile_info == NULL)
- return -ENOMEM;
-
- rc = CIFSSMBQPathInfo(xid, tcon, full_path, pfile_info,
- 0 /* not legacy */, cifs_sb->local_nls,
- cifs_sb->mnt_cifs_flags &
- CIFS_MOUNT_MAP_SPECIAL_CHR);
-
- if (rc == -EOPNOTSUPP || rc == -EINVAL)
- rc = SMBQueryInformation(xid, tcon, full_path, pfile_info,
- cifs_sb->local_nls, cifs_sb->mnt_cifs_flags &
- CIFS_MOUNT_MAP_SPECIAL_CHR);
- kfree(pfile_info);
- return rc;
-}
-
static void
cleanup_volume_info_contents(struct smb_vol *volume_info)
{
@@ -3703,13 +3679,18 @@ remote_path_check:
/* check if a whole path is not remote */
if (!rc && tcon) {
+ if (!server->ops->is_path_accessible) {
+ rc = -ENOSYS;
+ goto mount_fail_check;
+ }
/* build_path_to_root works only when we have a valid tcon */
full_path = cifs_build_path_to_root(volume_info, cifs_sb, tcon);
if (full_path == NULL) {
rc = -ENOMEM;
goto mount_fail_check;
}
- rc = is_path_accessible(xid, tcon, cifs_sb, full_path);
+ rc = server->ops->is_path_accessible(xid, tcon, cifs_sb,
+ full_path);
if (rc != 0 && rc != -EREMOTE) {
kfree(full_path);
goto mount_fail_check;