diff options
author | Pavel Shilovsky <piastry@etersoft.ru> | 2012-09-19 09:22:43 -0400 |
---|---|---|
committer | Steve French <smfrench@gmail.com> | 2012-09-24 22:46:32 -0400 |
commit | 027e8eec31d8141a6231f772e10ccae60c9d5c13 (patch) | |
tree | 51128bb874abe71a416c6d36198c261e0142e606 /fs/cifs | |
parent | d39a4f710b7a7be05b6ed9d4ab8fac754c139f8a (diff) |
CIFS: Handle SMB2 lock flags
Signed-off-by: Pavel Shilovsky <piastry@etersoft.ru>
Diffstat (limited to 'fs/cifs')
-rw-r--r-- | fs/cifs/smb2ops.c | 12 | ||||
-rw-r--r-- | fs/cifs/smb2pdu.h | 5 |
2 files changed, 17 insertions, 0 deletions
diff --git a/fs/cifs/smb2ops.c b/fs/cifs/smb2ops.c index b1dedf8cb372..e4a59d1f06b1 100644 --- a/fs/cifs/smb2ops.c +++ b/fs/cifs/smb2ops.c | |||
@@ -537,7 +537,15 @@ smb2_queryfs(const unsigned int xid, struct cifs_tcon *tcon, | |||
537 | return rc; | 537 | return rc; |
538 | } | 538 | } |
539 | 539 | ||
540 | static bool | ||
541 | smb2_compare_fids(struct cifsFileInfo *ob1, struct cifsFileInfo *ob2) | ||
542 | { | ||
543 | return ob1->fid.persistent_fid == ob2->fid.persistent_fid && | ||
544 | ob1->fid.volatile_fid == ob2->fid.volatile_fid; | ||
545 | } | ||
546 | |||
540 | struct smb_version_operations smb21_operations = { | 547 | struct smb_version_operations smb21_operations = { |
548 | .compare_fids = smb2_compare_fids, | ||
541 | .setup_request = smb2_setup_request, | 549 | .setup_request = smb2_setup_request, |
542 | .setup_async_request = smb2_setup_async_request, | 550 | .setup_async_request = smb2_setup_async_request, |
543 | .check_receive = smb2_check_receive, | 551 | .check_receive = smb2_check_receive, |
@@ -598,6 +606,10 @@ struct smb_version_operations smb21_operations = { | |||
598 | 606 | ||
599 | struct smb_version_values smb21_values = { | 607 | struct smb_version_values smb21_values = { |
600 | .version_string = SMB21_VERSION_STRING, | 608 | .version_string = SMB21_VERSION_STRING, |
609 | .large_lock_type = 0, | ||
610 | .exclusive_lock_type = SMB2_LOCKFLAG_EXCLUSIVE_LOCK, | ||
611 | .shared_lock_type = SMB2_LOCKFLAG_SHARED_LOCK, | ||
612 | .unlock_lock_type = SMB2_LOCKFLAG_UNLOCK, | ||
601 | .header_size = sizeof(struct smb2_hdr), | 613 | .header_size = sizeof(struct smb2_hdr), |
602 | .max_header_size = MAX_SMB2_HDR_SIZE, | 614 | .max_header_size = MAX_SMB2_HDR_SIZE, |
603 | .read_rsp_size = sizeof(struct smb2_read_rsp) - 1, | 615 | .read_rsp_size = sizeof(struct smb2_read_rsp) - 1, |
diff --git a/fs/cifs/smb2pdu.h b/fs/cifs/smb2pdu.h index 3c8e99ea88ad..d2d132e94155 100644 --- a/fs/cifs/smb2pdu.h +++ b/fs/cifs/smb2pdu.h | |||
@@ -526,6 +526,11 @@ struct smb2_write_rsp { | |||
526 | __u8 Buffer[1]; | 526 | __u8 Buffer[1]; |
527 | } __packed; | 527 | } __packed; |
528 | 528 | ||
529 | #define SMB2_LOCKFLAG_SHARED_LOCK 0x0001 | ||
530 | #define SMB2_LOCKFLAG_EXCLUSIVE_LOCK 0x0002 | ||
531 | #define SMB2_LOCKFLAG_UNLOCK 0x0004 | ||
532 | #define SMB2_LOCKFLAG_FAIL_IMMEDIATELY 0x0010 | ||
533 | |||
529 | struct smb2_echo_req { | 534 | struct smb2_echo_req { |
530 | struct smb2_hdr hdr; | 535 | struct smb2_hdr hdr; |
531 | __le16 StructureSize; /* Must be 4 */ | 536 | __le16 StructureSize; /* Must be 4 */ |