aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve French <smfrench@gmail.com>2012-09-19 12:19:39 -0400
committerSteve French <smfrench@gmail.com>2012-09-24 22:46:34 -0400
commit12e8a20824677fbc24e921d7aebfda6a47cc25b1 (patch)
treeef2e1e208d6a698d6e9468e3e49762a95d9a9f1f
parentba02e89915afcfc9a071a86e5cae32f77c7d353a (diff)
Trivial endian fixes
Some trivial endian fixes for the SMB2 code. One warning remains which I asked Pavel to look at. Reviewed-by: Pavel Shilovsky <piastry@etersoft.ru> Signed-off-by: Steve French <smfrench@gmail.com>
-rw-r--r--fs/cifs/smb2misc.c5
-rw-r--r--fs/cifs/smb2ops.c2
2 files changed, 4 insertions, 3 deletions
diff --git a/fs/cifs/smb2misc.c b/fs/cifs/smb2misc.c
index cd31715f03f4..7b1c5e3287fb 100644
--- a/fs/cifs/smb2misc.c
+++ b/fs/cifs/smb2misc.c
@@ -422,7 +422,8 @@ smb2_is_valid_lease_break(char *buffer, struct TCP_Server_Info *server)
422 struct cifs_pending_open *open; 422 struct cifs_pending_open *open;
423 struct smb2_lease_break_work *lw; 423 struct smb2_lease_break_work *lw;
424 bool found; 424 bool found;
425 int ack_req = rsp->Flags & SMB2_NOTIFY_BREAK_LEASE_FLAG_ACK_REQUIRED; 425 int ack_req = le32_to_cpu(rsp->Flags &
426 SMB2_NOTIFY_BREAK_LEASE_FLAG_ACK_REQUIRED);
426 427
427 lw = kmalloc(sizeof(struct smb2_lease_break_work), GFP_KERNEL); 428 lw = kmalloc(sizeof(struct smb2_lease_break_work), GFP_KERNEL);
428 if (!lw) { 429 if (!lw) {
@@ -524,7 +525,7 @@ smb2_is_valid_oplock_break(char *buffer, struct TCP_Server_Info *server)
524 if (rsp->hdr.Command != SMB2_OPLOCK_BREAK) 525 if (rsp->hdr.Command != SMB2_OPLOCK_BREAK)
525 return false; 526 return false;
526 527
527 if (le16_to_cpu(rsp->StructureSize) != 528 if (rsp->StructureSize !=
528 smb2_rsp_struct_sizes[SMB2_OPLOCK_BREAK_HE]) { 529 smb2_rsp_struct_sizes[SMB2_OPLOCK_BREAK_HE]) {
529 if (le16_to_cpu(rsp->StructureSize) == 44) 530 if (le16_to_cpu(rsp->StructureSize) == 44)
530 return smb2_is_valid_lease_break(buffer, server); 531 return smb2_is_valid_lease_break(buffer, server);
diff --git a/fs/cifs/smb2ops.c b/fs/cifs/smb2ops.c
index 630156f98cc7..2183bb343edd 100644
--- a/fs/cifs/smb2ops.c
+++ b/fs/cifs/smb2ops.c
@@ -496,7 +496,7 @@ smb2_is_status_pending(char *buf, struct TCP_Server_Info *server, int length)
496{ 496{
497 struct smb2_hdr *hdr = (struct smb2_hdr *)buf; 497 struct smb2_hdr *hdr = (struct smb2_hdr *)buf;
498 498
499 if (le32_to_cpu(hdr->Status) != STATUS_PENDING) 499 if (hdr->Status != STATUS_PENDING)
500 return false; 500 return false;
501 501
502 if (!length) { 502 if (!length) {