aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/smb1ops.c
diff options
context:
space:
mode:
authorSteve French <smfrench@gmail.com>2012-11-28 23:34:41 -0500
committerSteve French <smfrench@gmail.com>2012-12-05 14:27:28 -0500
commit6d3ea7e4975aed451fbee4dea2fef63b0de8cb4f (patch)
tree499881d40ec894a38bf017328fb48ebbaa30ec1b /fs/cifs/smb1ops.c
parente5e69abd058b3fcfd484dbe1c632347332cda9b6 (diff)
CIFS: Make use of common cifs_build_path_to_root for CIFS and SMB2
because the is no difference here. This also adds support of prefixpath mount option for SMB2. Signed-off-by: Pavel Shilovsky <piastry@etersoft.ru> Reviewed-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve French <smfrench@gmail.com>
Diffstat (limited to 'fs/cifs/smb1ops.c')
-rw-r--r--fs/cifs/smb1ops.c32
1 files changed, 0 insertions, 32 deletions
diff --git a/fs/cifs/smb1ops.c b/fs/cifs/smb1ops.c
index 34cea2798333..a5d234c8d5d9 100644
--- a/fs/cifs/smb1ops.c
+++ b/fs/cifs/smb1ops.c
@@ -575,37 +575,6 @@ cifs_query_file_info(const unsigned int xid, struct cifs_tcon *tcon,
575 return CIFSSMBQFileInfo(xid, tcon, fid->netfid, data); 575 return CIFSSMBQFileInfo(xid, tcon, fid->netfid, data);
576} 576}
577 577
578static char *
579cifs_build_path_to_root(struct smb_vol *vol, struct cifs_sb_info *cifs_sb,
580 struct cifs_tcon *tcon)
581{
582 int pplen = vol->prepath ? strlen(vol->prepath) : 0;
583 int dfsplen;
584 char *full_path = NULL;
585
586 /* if no prefix path, simply set path to the root of share to "" */
587 if (pplen == 0) {
588 full_path = kzalloc(1, GFP_KERNEL);
589 return full_path;
590 }
591
592 if (tcon->Flags & SMB_SHARE_IS_IN_DFS)
593 dfsplen = strnlen(tcon->treeName, MAX_TREE_SIZE + 1);
594 else
595 dfsplen = 0;
596
597 full_path = kmalloc(dfsplen + pplen + 1, GFP_KERNEL);
598 if (full_path == NULL)
599 return full_path;
600
601 if (dfsplen)
602 strncpy(full_path, tcon->treeName, dfsplen);
603 strncpy(full_path + dfsplen, vol->prepath, pplen);
604 convert_delimiter(full_path, CIFS_DIR_SEP(cifs_sb));
605 full_path[dfsplen + pplen] = 0; /* add trailing null */
606 return full_path;
607}
608
609static void 578static void
610cifs_clear_stats(struct cifs_tcon *tcon) 579cifs_clear_stats(struct cifs_tcon *tcon)
611{ 580{
@@ -943,7 +912,6 @@ struct smb_version_operations smb1_operations = {
943 .set_path_size = CIFSSMBSetEOF, 912 .set_path_size = CIFSSMBSetEOF,
944 .set_file_size = CIFSSMBSetFileSize, 913 .set_file_size = CIFSSMBSetFileSize,
945 .set_file_info = smb_set_file_info, 914 .set_file_info = smb_set_file_info,
946 .build_path_to_root = cifs_build_path_to_root,
947 .echo = CIFSSMBEcho, 915 .echo = CIFSSMBEcho,
948 .mkdir = CIFSSMBMkDir, 916 .mkdir = CIFSSMBMkDir,
949 .mkdir_setinfo = cifs_mkdir_setinfo, 917 .mkdir_setinfo = cifs_mkdir_setinfo,