summaryrefslogtreecommitdiffstats
path: root/fs/cifs/smb2ops.c
diff options
context:
space:
mode:
authorPavel Shilovsky2012-09-19 15:22:43 +0200
committerSteve French2012-09-25 04:46:32 +0200
commit027e8eec31d8141a6231f772e10ccae60c9d5c13 (patch)
tree51128bb874abe71a416c6d36198c261e0142e606 /fs/cifs/smb2ops.c
parentCIFS: Move brlock code to ops struct (diff)
downloadkernel-qcow2-linux-027e8eec31d8141a6231f772e10ccae60c9d5c13.tar.gz
kernel-qcow2-linux-027e8eec31d8141a6231f772e10ccae60c9d5c13.tar.xz
kernel-qcow2-linux-027e8eec31d8141a6231f772e10ccae60c9d5c13.zip
CIFS: Handle SMB2 lock flags
Signed-off-by: Pavel Shilovsky <piastry@etersoft.ru>
Diffstat (limited to 'fs/cifs/smb2ops.c')
-rw-r--r--fs/cifs/smb2ops.c12
1 files changed, 12 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,
return rc;
}
+static bool
+smb2_compare_fids(struct cifsFileInfo *ob1, struct cifsFileInfo *ob2)
+{
+ return ob1->fid.persistent_fid == ob2->fid.persistent_fid &&
+ ob1->fid.volatile_fid == ob2->fid.volatile_fid;
+}
+
struct smb_version_operations smb21_operations = {
+ .compare_fids = smb2_compare_fids,
.setup_request = smb2_setup_request,
.setup_async_request = smb2_setup_async_request,
.check_receive = smb2_check_receive,
@@ -598,6 +606,10 @@ struct smb_version_operations smb21_operations = {
struct smb_version_values smb21_values = {
.version_string = SMB21_VERSION_STRING,
+ .large_lock_type = 0,
+ .exclusive_lock_type = SMB2_LOCKFLAG_EXCLUSIVE_LOCK,
+ .shared_lock_type = SMB2_LOCKFLAG_SHARED_LOCK,
+ .unlock_lock_type = SMB2_LOCKFLAG_UNLOCK,
.header_size = sizeof(struct smb2_hdr),
.max_header_size = MAX_SMB2_HDR_SIZE,
.read_rsp_size = sizeof(struct smb2_read_rsp) - 1,