diff options
author | Pavel Shilovsky <pshilovsky@samba.org> | 2012-09-18 19:20:25 -0400 |
---|---|---|
committer | Steve French <smfrench@gmail.com> | 2012-09-24 22:46:26 -0400 |
commit | ed6875e0d6c28e4a6b44da04d6d4363b3d92d630 (patch) | |
tree | 9a5aa48100f62ed65319950689e911cb702abbaa /fs/cifs/cifssmb.c | |
parent | 56d27adcb536b7430d5f8a6240df8ad261eb00bd (diff) |
CIFS: Move unlink code to ops struct
Reviewed-by: Jeff Layton <jlayton@redhat.com>
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.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c index f0cf934ba877..2dddf01d2b66 100644 --- a/fs/cifs/cifssmb.c +++ b/fs/cifs/cifssmb.c | |||
@@ -902,15 +902,15 @@ PsxDelete: | |||
902 | } | 902 | } |
903 | 903 | ||
904 | int | 904 | int |
905 | CIFSSMBDelFile(const unsigned int xid, struct cifs_tcon *tcon, | 905 | CIFSSMBDelFile(const unsigned int xid, struct cifs_tcon *tcon, const char *name, |
906 | const char *fileName, const struct nls_table *nls_codepage, | 906 | struct cifs_sb_info *cifs_sb) |
907 | int remap) | ||
908 | { | 907 | { |
909 | DELETE_FILE_REQ *pSMB = NULL; | 908 | DELETE_FILE_REQ *pSMB = NULL; |
910 | DELETE_FILE_RSP *pSMBr = NULL; | 909 | DELETE_FILE_RSP *pSMBr = NULL; |
911 | int rc = 0; | 910 | int rc = 0; |
912 | int bytes_returned; | 911 | int bytes_returned; |
913 | int name_len; | 912 | int name_len; |
913 | int remap = cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR; | ||
914 | 914 | ||
915 | DelFileRetry: | 915 | DelFileRetry: |
916 | rc = smb_init(SMB_COM_DELETE, 1, tcon, (void **) &pSMB, | 916 | rc = smb_init(SMB_COM_DELETE, 1, tcon, (void **) &pSMB, |
@@ -919,15 +919,15 @@ DelFileRetry: | |||
919 | return rc; | 919 | return rc; |
920 | 920 | ||
921 | if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) { | 921 | if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) { |
922 | name_len = | 922 | name_len = cifsConvertToUTF16((__le16 *) pSMB->fileName, name, |
923 | cifsConvertToUTF16((__le16 *) pSMB->fileName, fileName, | 923 | PATH_MAX, cifs_sb->local_nls, |
924 | PATH_MAX, nls_codepage, remap); | 924 | remap); |
925 | name_len++; /* trailing null */ | 925 | name_len++; /* trailing null */ |
926 | name_len *= 2; | 926 | name_len *= 2; |
927 | } else { /* BB improve check for buffer overruns BB */ | 927 | } else { /* BB improve check for buffer overruns BB */ |
928 | name_len = strnlen(fileName, PATH_MAX); | 928 | name_len = strnlen(name, PATH_MAX); |
929 | name_len++; /* trailing null */ | 929 | name_len++; /* trailing null */ |
930 | strncpy(pSMB->fileName, fileName, name_len); | 930 | strncpy(pSMB->fileName, name, name_len); |
931 | } | 931 | } |
932 | pSMB->SearchAttributes = | 932 | pSMB->SearchAttributes = |
933 | cpu_to_le16(ATTR_READONLY | ATTR_HIDDEN | ATTR_SYSTEM); | 933 | cpu_to_le16(ATTR_READONLY | ATTR_HIDDEN | ATTR_SYSTEM); |