aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/cifssmb.c
diff options
context:
space:
mode:
authorPavel Shilovsky <pshilovsky@samba.org>2012-07-10 08:14:18 -0400
committerSteve French <smfrench@gmail.com>2012-07-27 16:17:47 -0400
commitf958ca5d88e6071767b10549d544b3475dfb6996 (patch)
tree4e64f85c54c287b98740936b27a96b27cac4e110 /fs/cifs/cifssmb.c
parenta0e731839dd461eee0fe2dc026e0965e961e2730 (diff)
CIFS: Move rmdir code to ops struct
Signed-off-by: Pavel Shilovsky <pshilovsky@samba.org> Signed-off-by: Steve French <smfrench@gmail.com>
Diffstat (limited to 'fs/cifs/cifssmb.c')
-rw-r--r--fs/cifs/cifssmb.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c
index eb74cceef480..074923ce593d 100644
--- a/fs/cifs/cifssmb.c
+++ b/fs/cifs/cifssmb.c
@@ -948,15 +948,15 @@ DelFileRetry:
948} 948}
949 949
950int 950int
951CIFSSMBRmDir(const unsigned int xid, struct cifs_tcon *tcon, 951CIFSSMBRmDir(const unsigned int xid, struct cifs_tcon *tcon, const char *name,
952 const char *dirName, const struct nls_table *nls_codepage, 952 struct cifs_sb_info *cifs_sb)
953 int remap)
954{ 953{
955 DELETE_DIRECTORY_REQ *pSMB = NULL; 954 DELETE_DIRECTORY_REQ *pSMB = NULL;
956 DELETE_DIRECTORY_RSP *pSMBr = NULL; 955 DELETE_DIRECTORY_RSP *pSMBr = NULL;
957 int rc = 0; 956 int rc = 0;
958 int bytes_returned; 957 int bytes_returned;
959 int name_len; 958 int name_len;
959 int remap = cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR;
960 960
961 cFYI(1, "In CIFSSMBRmDir"); 961 cFYI(1, "In CIFSSMBRmDir");
962RmDirRetry: 962RmDirRetry:
@@ -966,14 +966,15 @@ RmDirRetry:
966 return rc; 966 return rc;
967 967
968 if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) { 968 if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) {
969 name_len = cifsConvertToUTF16((__le16 *) pSMB->DirName, dirName, 969 name_len = cifsConvertToUTF16((__le16 *) pSMB->DirName, name,
970 PATH_MAX, nls_codepage, remap); 970 PATH_MAX, cifs_sb->local_nls,
971 remap);
971 name_len++; /* trailing null */ 972 name_len++; /* trailing null */
972 name_len *= 2; 973 name_len *= 2;
973 } else { /* BB improve check for buffer overruns BB */ 974 } else { /* BB improve check for buffer overruns BB */
974 name_len = strnlen(dirName, PATH_MAX); 975 name_len = strnlen(name, PATH_MAX);
975 name_len++; /* trailing null */ 976 name_len++; /* trailing null */
976 strncpy(pSMB->DirName, dirName, name_len); 977 strncpy(pSMB->DirName, name, name_len);
977 } 978 }
978 979
979 pSMB->BufferFormat = 0x04; 980 pSMB->BufferFormat = 0x04;