Skip to content

Commit 6c9903c

Browse files
Dr. David Alan Gilbertsmfrench
authored andcommitted
cifs: Remove pre-historic unused CIFSSMBCopy
CIFSSMBCopy() is unused, remove it. It seems to have been that way pre-git; looking in a historic archive, I think it landed around May 2004 in Linus' BKrev: 40ab7591J_OgkpHW-qhzZukvAUAw9g and was unused back then. Signed-off-by: Dr. David Alan Gilbert <[email protected]> Acked-by: Tom Talpey <[email protected]> Signed-off-by: Steve French <[email protected]>
1 parent adc2186 commit 6c9903c

File tree

2 files changed

+0
-70
lines changed

2 files changed

+0
-70
lines changed

fs/smb/client/cifsproto.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -549,13 +549,6 @@ extern int generate_smb311signingkey(struct cifs_ses *ses,
549549
struct TCP_Server_Info *server);
550550

551551
#ifdef CONFIG_CIFS_ALLOW_INSECURE_LEGACY
552-
extern int CIFSSMBCopy(unsigned int xid,
553-
struct cifs_tcon *source_tcon,
554-
const char *fromName,
555-
const __u16 target_tid,
556-
const char *toName, const int flags,
557-
const struct nls_table *nls_codepage,
558-
int remap_special_chars);
559552
extern ssize_t CIFSSMBQAllEAs(const unsigned int xid, struct cifs_tcon *tcon,
560553
const unsigned char *searchName,
561554
const unsigned char *ea_name, char *EAData,

fs/smb/client/cifssmb.c

Lines changed: 0 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -2339,69 +2339,6 @@ int CIFSSMBRenameOpenFile(const unsigned int xid, struct cifs_tcon *pTcon,
23392339
return rc;
23402340
}
23412341

2342-
int
2343-
CIFSSMBCopy(const unsigned int xid, struct cifs_tcon *tcon,
2344-
const char *fromName, const __u16 target_tid, const char *toName,
2345-
const int flags, const struct nls_table *nls_codepage, int remap)
2346-
{
2347-
int rc = 0;
2348-
COPY_REQ *pSMB = NULL;
2349-
COPY_RSP *pSMBr = NULL;
2350-
int bytes_returned;
2351-
int name_len, name_len2;
2352-
__u16 count;
2353-
2354-
cifs_dbg(FYI, "In CIFSSMBCopy\n");
2355-
copyRetry:
2356-
rc = smb_init(SMB_COM_COPY, 1, tcon, (void **) &pSMB,
2357-
(void **) &pSMBr);
2358-
if (rc)
2359-
return rc;
2360-
2361-
pSMB->BufferFormat = 0x04;
2362-
pSMB->Tid2 = target_tid;
2363-
2364-
pSMB->Flags = cpu_to_le16(flags & COPY_TREE);
2365-
2366-
if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) {
2367-
name_len = cifsConvertToUTF16((__le16 *) pSMB->OldFileName,
2368-
fromName, PATH_MAX, nls_codepage,
2369-
remap);
2370-
name_len++; /* trailing null */
2371-
name_len *= 2;
2372-
pSMB->OldFileName[name_len] = 0x04; /* pad */
2373-
/* protocol requires ASCII signature byte on Unicode string */
2374-
pSMB->OldFileName[name_len + 1] = 0x00;
2375-
name_len2 =
2376-
cifsConvertToUTF16((__le16 *)&pSMB->OldFileName[name_len+2],
2377-
toName, PATH_MAX, nls_codepage, remap);
2378-
name_len2 += 1 /* trailing null */ + 1 /* Signature word */ ;
2379-
name_len2 *= 2; /* convert to bytes */
2380-
} else {
2381-
name_len = copy_path_name(pSMB->OldFileName, fromName);
2382-
pSMB->OldFileName[name_len] = 0x04; /* 2nd buffer format */
2383-
name_len2 = copy_path_name(pSMB->OldFileName+name_len+1, toName);
2384-
name_len2++; /* signature byte */
2385-
}
2386-
2387-
count = 1 /* 1st signature byte */ + name_len + name_len2;
2388-
inc_rfc1001_len(pSMB, count);
2389-
pSMB->ByteCount = cpu_to_le16(count);
2390-
2391-
rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
2392-
(struct smb_hdr *) pSMBr, &bytes_returned, 0);
2393-
if (rc) {
2394-
cifs_dbg(FYI, "Send error in copy = %d with %d files copied\n",
2395-
rc, le16_to_cpu(pSMBr->CopyCount));
2396-
}
2397-
cifs_buf_release(pSMB);
2398-
2399-
if (rc == -EAGAIN)
2400-
goto copyRetry;
2401-
2402-
return rc;
2403-
}
2404-
24052342
int
24062343
CIFSUnixCreateSymLink(const unsigned int xid, struct cifs_tcon *tcon,
24072344
const char *fromName, const char *toName,

0 commit comments

Comments
 (0)