From 6e9e9e24a582259eba3d8444ef7ef8a5d8101b97 Mon Sep 17 00:00:00 2001 From: Alexander Viro Date: Tue, 21 Sep 2004 02:49:28 -0700 Subject: [PATCH] [PATCH] cifs: annotate NT_RENAME_{REQ,RESP} Signed-off-by: Al Viro Signed-off-by: Linus Torvalds --- fs/cifs/cifspdu.h | 8 ++++---- fs/cifs/cifssmb.c | 7 ++++--- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/fs/cifs/cifspdu.h b/fs/cifs/cifspdu.h index 0353bf94f94ae..e7eb3dafb85e5 100644 --- a/fs/cifs/cifspdu.h +++ b/fs/cifs/cifspdu.h @@ -810,10 +810,10 @@ typedef struct smb_com_copy_rsp { typedef struct smb_com_nt_rename_req { /* A5 - also used for create hardlink */ struct smb_hdr hdr; /* wct = 4 */ - __u16 SearchAttributes; /* target file attributes */ - __u16 Flags; /* spec says Information Level */ - __u32 ClusterCount; - __u16 ByteCount; + __le16 SearchAttributes; /* target file attributes */ + __le16 Flags; /* spec says Information Level */ + __le32 ClusterCount; + __le16 ByteCount; __u8 BufferFormat; /* 4 = ASCII or Unicode */ unsigned char OldFileName[1]; /* followed by __u8 BufferFormat2 */ diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c index 33ce09450f95d..e7efda7a930af 100644 --- a/fs/cifs/cifssmb.c +++ b/fs/cifs/cifssmb.c @@ -1306,6 +1306,7 @@ CIFSCreateHardLink(const int xid, struct cifsTconInfo *tcon, RENAME_RSP *pSMBr = NULL; int bytes_returned; int name_len, name_len2; + __u16 count; cFYI(1, ("In CIFSCreateHardLink")); winCreateHardLinkRetry: @@ -1350,9 +1351,9 @@ winCreateHardLinkRetry: name_len2++; /* signature byte */ } - pSMB->ByteCount = 1 /* string type byte */ + name_len + name_len2; - pSMB->hdr.smb_buf_length += pSMB->ByteCount; - pSMB->ByteCount = cpu_to_le16(pSMB->ByteCount); + count = 1 /* string type byte */ + name_len + name_len2; + pSMB->hdr.smb_buf_length += count; + pSMB->ByteCount = cpu_to_le16(count); rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, (struct smb_hdr *) pSMBr, &bytes_returned, 0); -- 2.53.0