diff mbox series

[11/19] cifs: remove rfc1002 header from smb2_flush_req

Message ID 20171109011433.14468-12-lsahlber@redhat.com
State New
Headers show
Series Remove rfc1002 header from smb2 request structs | expand

Commit Message

Ronnie Sahlberg Nov. 9, 2017, 1:14 a.m. UTC
Signed-off-by: Ronnie Sahlberg <lsahlber@redhat.com>
---
 fs/cifs/smb2pdu.c | 8 ++++----
 fs/cifs/smb2pdu.h | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

Comments

Aurélien Aptel Nov. 9, 2017, 2:11 p.m. UTC | #1
Reviewed-by: Aurelien Aptel <aaptel@suse.com>
diff mbox series

Patch

diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c
index a9726a2b7b88..144395bab5c1 100644
--- a/fs/cifs/smb2pdu.c
+++ b/fs/cifs/smb2pdu.c
@@ -2427,13 +2427,14 @@  SMB2_flush(const unsigned int xid, struct cifs_tcon *tcon, u64 persistent_fid,
 	int resp_buftype;
 	int rc = 0;
 	int flags = 0;
+	unsigned int total_len;
 
 	cifs_dbg(FYI, "Flush\n");
 
 	if (!ses || !(ses->server))
 		return -EIO;
 
-	rc = small_smb2_init(SMB2_FLUSH, tcon, (void **) &req);
+	rc = smb2_plain_req_init(SMB2_FLUSH, tcon, (void **) &req, &total_len);
 	if (rc)
 		return rc;
 
@@ -2444,10 +2445,9 @@  SMB2_flush(const unsigned int xid, struct cifs_tcon *tcon, u64 persistent_fid,
 	req->VolatileFileId = volatile_fid;
 
 	iov[0].iov_base = (char *)req;
-	/* 4 for rfc1002 length field */
-	iov[0].iov_len = get_rfc1002_length(req) + 4;
+	iov[0].iov_len = total_len;
 
-	rc = SendReceive2(xid, ses, iov, 1, &resp_buftype, flags, &rsp_iov);
+	rc = smb2_send_recv(xid, ses, iov, 1, &resp_buftype, flags, &rsp_iov);
 	cifs_small_buf_release(req);
 
 	if (rc != 0)
diff --git a/fs/cifs/smb2pdu.h b/fs/cifs/smb2pdu.h
index 6e1874a81014..a8102e5f4ebb 100644
--- a/fs/cifs/smb2pdu.h
+++ b/fs/cifs/smb2pdu.h
@@ -812,7 +812,7 @@  struct smb2_close_rsp {
 } __packed;
 
 struct smb2_flush_req {
-	struct smb2_hdr hdr;
+	struct smb2_sync_hdr sync_hdr;
 	__le16 StructureSize;	/* Must be 24 */
 	__le16 Reserved1;
 	__le32 Reserved2;