summaryrefslogtreecommitdiffstats
path: root/fs/cifs/smb2pdu.c
diff options
context:
space:
mode:
authorPavel Shilovsky <pshilovsky@samba.org>2012-09-18 16:20:33 -0700
committerSteve French <smfrench@gmail.com>2012-09-24 21:46:30 -0500
commit2e44b2887882134abf353b28867b82645e9f0856 (patch)
tree963236eb542e26b046960f72f9ec47ae8e339a76 /fs/cifs/smb2pdu.c
parentd324f08d6a87149597817f4496ef0f7ac185e8da (diff)
downloadlinux-2e44b2887882134abf353b28867b82645e9f0856.tar.bz2
CIFS: Process oplocks for SMB2
Signed-off-by: Pavel Shilovsky <piastryyy@gmail.com> Signed-off-by: Steve French <smfrench@gmail.com>
Diffstat (limited to 'fs/cifs/smb2pdu.c')
-rw-r--r--fs/cifs/smb2pdu.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c
index 21b3a652e192..e97c256c8a42 100644
--- a/fs/cifs/smb2pdu.c
+++ b/fs/cifs/smb2pdu.c
@@ -872,7 +872,7 @@ int
SMB2_open(const unsigned int xid, struct cifs_tcon *tcon, __le16 *path,
u64 *persistent_fid, u64 *volatile_fid, __u32 desired_access,
__u32 create_disposition, __u32 file_attributes, __u32 create_options,
- struct smb2_file_all_info *buf)
+ __u8 *oplock, struct smb2_file_all_info *buf)
{
struct smb2_create_req *req;
struct smb2_create_rsp *rsp;
@@ -895,9 +895,9 @@ SMB2_open(const unsigned int xid, struct cifs_tcon *tcon, __le16 *path,
if (rc)
return rc;
- /* if (server->oplocks)
- req->RequestedOplockLevel = SMB2_OPLOCK_LEVEL_BATCH;
- else */
+ if (server->oplocks)
+ req->RequestedOplockLevel = *oplock;
+ else
req->RequestedOplockLevel = SMB2_OPLOCK_LEVEL_NONE;
req->ImpersonationLevel = IL_IMPERSONATION;
req->DesiredAccess = cpu_to_le32(desired_access);
@@ -954,6 +954,8 @@ SMB2_open(const unsigned int xid, struct cifs_tcon *tcon, __le16 *path,
buf->NumberOfLinks = cpu_to_le32(1);
buf->DeletePending = 0;
}
+
+ *oplock = rsp->OplockLevel;
creat_exit:
free_rsp_buf(resp_buftype, rsp);
return rc;