aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/smb2ops.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/cifs/smb2ops.c')
-rw-r--r--fs/cifs/smb2ops.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/fs/cifs/smb2ops.c b/fs/cifs/smb2ops.c
index ecff4d6e4b16..0215e60267e2 100644
--- a/fs/cifs/smb2ops.c
+++ b/fs/cifs/smb2ops.c
@@ -748,6 +748,16 @@ smb2_create_lease_buf(u8 *lease_key, u8 oplock)
748 return (char *)buf; 748 return (char *)buf;
749} 749}
750 750
751static __u8
752smb2_parse_lease_buf(void *buf)
753{
754 struct create_lease *lc = (struct create_lease *)buf;
755
756 if (lc->lcontext.LeaseFlags & SMB2_LEASE_FLAG_BREAK_IN_PROGRESS)
757 return SMB2_OPLOCK_LEVEL_NOCHANGE;
758 return le32_to_cpu(lc->lcontext.LeaseState);
759}
760
751struct smb_version_operations smb20_operations = { 761struct smb_version_operations smb20_operations = {
752 .compare_fids = smb2_compare_fids, 762 .compare_fids = smb2_compare_fids,
753 .setup_request = smb2_setup_request, 763 .setup_request = smb2_setup_request,
@@ -816,6 +826,7 @@ struct smb_version_operations smb20_operations = {
816 .is_read_op = smb2_is_read_op, 826 .is_read_op = smb2_is_read_op,
817 .set_oplock_level = smb2_set_oplock_level, 827 .set_oplock_level = smb2_set_oplock_level,
818 .create_lease_buf = smb2_create_lease_buf, 828 .create_lease_buf = smb2_create_lease_buf,
829 .parse_lease_buf = smb2_parse_lease_buf,
819}; 830};
820 831
821struct smb_version_operations smb21_operations = { 832struct smb_version_operations smb21_operations = {
@@ -886,6 +897,7 @@ struct smb_version_operations smb21_operations = {
886 .is_read_op = smb21_is_read_op, 897 .is_read_op = smb21_is_read_op,
887 .set_oplock_level = smb21_set_oplock_level, 898 .set_oplock_level = smb21_set_oplock_level,
888 .create_lease_buf = smb2_create_lease_buf, 899 .create_lease_buf = smb2_create_lease_buf,
900 .parse_lease_buf = smb2_parse_lease_buf,
889}; 901};
890 902
891struct smb_version_operations smb30_operations = { 903struct smb_version_operations smb30_operations = {
@@ -958,6 +970,7 @@ struct smb_version_operations smb30_operations = {
958 .is_read_op = smb21_is_read_op, 970 .is_read_op = smb21_is_read_op,
959 .set_oplock_level = smb21_set_oplock_level, 971 .set_oplock_level = smb21_set_oplock_level,
960 .create_lease_buf = smb2_create_lease_buf, 972 .create_lease_buf = smb2_create_lease_buf,
973 .parse_lease_buf = smb2_parse_lease_buf,
961}; 974};
962 975
963struct smb_version_values smb20_values = { 976struct smb_version_values smb20_values = {