Skip to content

Commit dbbab32

Browse files
author
Al Viro
committed
cifs: get rid of unused arguments of CIFSSMBWrite()
they used to be used, but... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
1 parent bc8bcf3 commit dbbab32

3 files changed

Lines changed: 5 additions & 13 deletions

File tree

‎fs/cifs/cifsproto.h‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -392,8 +392,7 @@ extern int CIFSSMBRead(const unsigned int xid, struct cifs_io_parms *io_parms,
392392
unsigned int *nbytes, char **buf,
393393
int *return_buf_type);
394394
extern int CIFSSMBWrite(const unsigned int xid, struct cifs_io_parms *io_parms,
395-
unsigned int *nbytes, const char *buf,
396-
const char __user *ubuf, const int long_op);
395+
unsigned int *nbytes, const char *buf);
397396
extern int CIFSSMBWrite2(const unsigned int xid, struct cifs_io_parms *io_parms,
398397
unsigned int *nbytes, struct kvec *iov, const int nvec);
399398
extern int CIFSGetSrvInodeNumber(const unsigned int xid, struct cifs_tcon *tcon,

‎fs/cifs/cifssmb.c‎

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1228,7 +1228,6 @@ SMBLegacyOpen(const unsigned int xid, struct cifs_tcon *tcon,
12281228
inc_rfc1001_len(pSMB, count);
12291229

12301230
pSMB->ByteCount = cpu_to_le16(count);
1231-
/* long_op set to 1 to allow for oplock break timeouts */
12321231
rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
12331232
(struct smb_hdr *)pSMBr, &bytes_returned, 0);
12341233
cifs_stats_inc(&tcon->stats.cifs_stats.num_opens);
@@ -1768,8 +1767,7 @@ CIFSSMBRead(const unsigned int xid, struct cifs_io_parms *io_parms,
17681767

17691768
int
17701769
CIFSSMBWrite(const unsigned int xid, struct cifs_io_parms *io_parms,
1771-
unsigned int *nbytes, const char *buf,
1772-
const char __user *ubuf, const int long_op)
1770+
unsigned int *nbytes, const char *buf)
17731771
{
17741772
int rc = -EACCES;
17751773
WRITE_REQ *pSMB = NULL;
@@ -1838,12 +1836,7 @@ CIFSSMBWrite(const unsigned int xid, struct cifs_io_parms *io_parms,
18381836
cpu_to_le16(offsetof(struct smb_com_write_req, Data) - 4);
18391837
if (buf)
18401838
memcpy(pSMB->Data, buf, bytes_sent);
1841-
else if (ubuf) {
1842-
if (copy_from_user(pSMB->Data, ubuf, bytes_sent)) {
1843-
cifs_buf_release(pSMB);
1844-
return -EFAULT;
1845-
}
1846-
} else if (count != 0) {
1839+
else if (count != 0) {
18471840
/* No buffer */
18481841
cifs_buf_release(pSMB);
18491842
return -EINVAL;
@@ -1867,7 +1860,7 @@ CIFSSMBWrite(const unsigned int xid, struct cifs_io_parms *io_parms,
18671860
}
18681861

18691862
rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
1870-
(struct smb_hdr *) pSMBr, &bytes_returned, long_op);
1863+
(struct smb_hdr *) pSMBr, &bytes_returned, 0);
18711864
cifs_stats_inc(&tcon->stats.cifs_stats.num_writes);
18721865
if (rc) {
18731866
cifs_dbg(FYI, "Send error in write = %d\n", rc);

‎fs/cifs/link.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ cifs_create_mf_symlink(unsigned int xid, struct cifs_tcon *tcon,
399399
io_parms.offset = 0;
400400
io_parms.length = CIFS_MF_SYMLINK_FILE_SIZE;
401401

402-
rc = CIFSSMBWrite(xid, &io_parms, pbytes_written, pbuf, NULL, 0);
402+
rc = CIFSSMBWrite(xid, &io_parms, pbytes_written, pbuf);
403403
CIFSSMBClose(xid, tcon, fid.netfid);
404404
return rc;
405405
}

0 commit comments

Comments
 (0)