diff options
author | Pavel Shilovsky <pshilovsky@samba.org> | 2013-09-05 20:16:45 +0400 |
---|---|---|
committer | Steve French <smfrench@gmail.com> | 2013-09-09 22:52:11 -0500 |
commit | b5c7cde3fac35e33835d37be59cb4e5a0b9cf3c2 (patch) | |
tree | 25c65c2f865d60c2d7c5c24bcf020c57c5074be8 /fs/cifs/smb2ops.c | |
parent | a41a28bda936ea627afbfe94a7f5cd63f23cf727 (diff) |
CIFS: Move parsing lease buffer to ops struct
Signed-off-by: Pavel Shilovsky <pshilovsky@samba.org>
Signed-off-by: Steve French <smfrench@gmail.com>
Diffstat (limited to 'fs/cifs/smb2ops.c')
-rw-r--r-- | fs/cifs/smb2ops.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/fs/cifs/smb2ops.c b/fs/cifs/smb2ops.c index ecff4d6e4b1..0215e60267e 100644 --- a/fs/cifs/smb2ops.c +++ b/fs/cifs/smb2ops.c @@ -748,6 +748,16 @@ smb2_create_lease_buf(u8 *lease_key, u8 oplock) return (char *)buf; } +static __u8 +smb2_parse_lease_buf(void *buf) +{ + struct create_lease *lc = (struct create_lease *)buf; + + if (lc->lcontext.LeaseFlags & SMB2_LEASE_FLAG_BREAK_IN_PROGRESS) + return SMB2_OPLOCK_LEVEL_NOCHANGE; + return le32_to_cpu(lc->lcontext.LeaseState); +} + struct smb_version_operations smb20_operations = { .compare_fids = smb2_compare_fids, .setup_request = smb2_setup_request, @@ -816,6 +826,7 @@ struct smb_version_operations smb20_operations = { .is_read_op = smb2_is_read_op, .set_oplock_level = smb2_set_oplock_level, .create_lease_buf = smb2_create_lease_buf, + .parse_lease_buf = smb2_parse_lease_buf, }; struct smb_version_operations smb21_operations = { @@ -886,6 +897,7 @@ struct smb_version_operations smb21_operations = { .is_read_op = smb21_is_read_op, .set_oplock_level = smb21_set_oplock_level, .create_lease_buf = smb2_create_lease_buf, + .parse_lease_buf = smb2_parse_lease_buf, }; struct smb_version_operations smb30_operations = { @@ -958,6 +970,7 @@ struct smb_version_operations smb30_operations = { .is_read_op = smb21_is_read_op, .set_oplock_level = smb21_set_oplock_level, .create_lease_buf = smb2_create_lease_buf, + .parse_lease_buf = smb2_parse_lease_buf, }; struct smb_version_values smb20_values = { |