aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/cifssmb.c
diff options
context:
space:
mode:
authorSteve French <smfrench@gmail.com>2012-09-18 19:20:31 -0400
committerSteve French <smfrench@gmail.com>2012-09-24 22:46:29 -0400
commitd6e906f1b571d15ff5778a049802f6ef6f70159a (patch)
tree25dd58336fed99bacea189a2fb632221a0d6f1aa /fs/cifs/cifssmb.c
parent35143eb5c2e3ae6c91b29144449d23f05f573796 (diff)
CIFS: Move hardlink to ops struct
Signed-off-by: Pavel Shilovsky <pshilovsky@samba.org> Signed-off-by: Steve French <sfrench@us.ibm.com> Signed-off-by: Steve French <smfrench@gmail.com>
Diffstat (limited to 'fs/cifs/cifssmb.c')
-rw-r--r--fs/cifs/cifssmb.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c
index b8cd335d6f11..eb3d2cf76e6e 100644
--- a/fs/cifs/cifssmb.c
+++ b/fs/cifs/cifssmb.c
@@ -2924,8 +2924,8 @@ createHardLinkRetry:
2924 2924
2925int 2925int
2926CIFSCreateHardLink(const unsigned int xid, struct cifs_tcon *tcon, 2926CIFSCreateHardLink(const unsigned int xid, struct cifs_tcon *tcon,
2927 const char *fromName, const char *toName, 2927 const char *from_name, const char *to_name,
2928 const struct nls_table *nls_codepage, int remap) 2928 struct cifs_sb_info *cifs_sb)
2929{ 2929{
2930 int rc = 0; 2930 int rc = 0;
2931 NT_RENAME_REQ *pSMB = NULL; 2931 NT_RENAME_REQ *pSMB = NULL;
@@ -2933,6 +2933,7 @@ CIFSCreateHardLink(const unsigned int xid, struct cifs_tcon *tcon,
2933 int bytes_returned; 2933 int bytes_returned;
2934 int name_len, name_len2; 2934 int name_len, name_len2;
2935 __u16 count; 2935 __u16 count;
2936 int remap = cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR;
2936 2937
2937 cFYI(1, "In CIFSCreateHardLink"); 2938 cFYI(1, "In CIFSCreateHardLink");
2938winCreateHardLinkRetry: 2939winCreateHardLinkRetry:
@@ -2952,8 +2953,8 @@ winCreateHardLinkRetry:
2952 2953
2953 if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) { 2954 if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) {
2954 name_len = 2955 name_len =
2955 cifsConvertToUTF16((__le16 *) pSMB->OldFileName, fromName, 2956 cifsConvertToUTF16((__le16 *) pSMB->OldFileName, from_name,
2956 PATH_MAX, nls_codepage, remap); 2957 PATH_MAX, cifs_sb->local_nls, remap);
2957 name_len++; /* trailing null */ 2958 name_len++; /* trailing null */
2958 name_len *= 2; 2959 name_len *= 2;
2959 2960
@@ -2962,17 +2963,18 @@ winCreateHardLinkRetry:
2962 pSMB->OldFileName[name_len + 1] = 0x00; /* pad */ 2963 pSMB->OldFileName[name_len + 1] = 0x00; /* pad */
2963 name_len2 = 2964 name_len2 =
2964 cifsConvertToUTF16((__le16 *)&pSMB->OldFileName[name_len+2], 2965 cifsConvertToUTF16((__le16 *)&pSMB->OldFileName[name_len+2],
2965 toName, PATH_MAX, nls_codepage, remap); 2966 to_name, PATH_MAX, cifs_sb->local_nls,
2967 remap);
2966 name_len2 += 1 /* trailing null */ + 1 /* Signature word */ ; 2968 name_len2 += 1 /* trailing null */ + 1 /* Signature word */ ;
2967 name_len2 *= 2; /* convert to bytes */ 2969 name_len2 *= 2; /* convert to bytes */
2968 } else { /* BB improve the check for buffer overruns BB */ 2970 } else { /* BB improve the check for buffer overruns BB */
2969 name_len = strnlen(fromName, PATH_MAX); 2971 name_len = strnlen(from_name, PATH_MAX);
2970 name_len++; /* trailing null */ 2972 name_len++; /* trailing null */
2971 strncpy(pSMB->OldFileName, fromName, name_len); 2973 strncpy(pSMB->OldFileName, from_name, name_len);
2972 name_len2 = strnlen(toName, PATH_MAX); 2974 name_len2 = strnlen(to_name, PATH_MAX);
2973 name_len2++; /* trailing null */ 2975 name_len2++; /* trailing null */
2974 pSMB->OldFileName[name_len] = 0x04; /* 2nd buffer format */ 2976 pSMB->OldFileName[name_len] = 0x04; /* 2nd buffer format */
2975 strncpy(&pSMB->OldFileName[name_len + 1], toName, name_len2); 2977 strncpy(&pSMB->OldFileName[name_len + 1], to_name, name_len2);
2976 name_len2++; /* trailing null */ 2978 name_len2++; /* trailing null */
2977 name_len2++; /* signature byte */ 2979 name_len2++; /* signature byte */
2978 } 2980 }