diff options
Diffstat (limited to 'fs/cifs/smb2ops.c')
| -rw-r--r-- | fs/cifs/smb2ops.c | 48 |
1 files changed, 47 insertions, 1 deletions
diff --git a/fs/cifs/smb2ops.c b/fs/cifs/smb2ops.c index f2e76f3b0c61..6d15cab95b99 100644 --- a/fs/cifs/smb2ops.c +++ b/fs/cifs/smb2ops.c | |||
| @@ -281,6 +281,25 @@ smb2_clear_stats(struct cifs_tcon *tcon) | |||
| 281 | } | 281 | } |
| 282 | 282 | ||
| 283 | static void | 283 | static void |
| 284 | smb2_dump_share_caps(struct seq_file *m, struct cifs_tcon *tcon) | ||
| 285 | { | ||
| 286 | seq_puts(m, "\n\tShare Capabilities:"); | ||
| 287 | if (tcon->capabilities & SMB2_SHARE_CAP_DFS) | ||
| 288 | seq_puts(m, " DFS,"); | ||
| 289 | if (tcon->capabilities & SMB2_SHARE_CAP_CONTINUOUS_AVAILABILITY) | ||
| 290 | seq_puts(m, " CONTINUOUS AVAILABILITY,"); | ||
| 291 | if (tcon->capabilities & SMB2_SHARE_CAP_SCALEOUT) | ||
| 292 | seq_puts(m, " SCALEOUT,"); | ||
| 293 | if (tcon->capabilities & SMB2_SHARE_CAP_CLUSTER) | ||
| 294 | seq_puts(m, " CLUSTER,"); | ||
| 295 | if (tcon->capabilities & SMB2_SHARE_CAP_ASYMMETRIC) | ||
| 296 | seq_puts(m, " ASYMMETRIC,"); | ||
| 297 | if (tcon->capabilities == 0) | ||
| 298 | seq_puts(m, " None"); | ||
| 299 | seq_printf(m, "\tShare Flags: 0x%x", tcon->share_flags); | ||
| 300 | } | ||
| 301 | |||
| 302 | static void | ||
| 284 | smb2_print_stats(struct seq_file *m, struct cifs_tcon *tcon) | 303 | smb2_print_stats(struct seq_file *m, struct cifs_tcon *tcon) |
| 285 | { | 304 | { |
| 286 | #ifdef CONFIG_CIFS_STATS | 305 | #ifdef CONFIG_CIFS_STATS |
| @@ -292,7 +311,6 @@ smb2_print_stats(struct seq_file *m, struct cifs_tcon *tcon) | |||
| 292 | seq_printf(m, "\nSessionSetups: %d sent %d failed", | 311 | seq_printf(m, "\nSessionSetups: %d sent %d failed", |
| 293 | atomic_read(&sent[SMB2_SESSION_SETUP_HE]), | 312 | atomic_read(&sent[SMB2_SESSION_SETUP_HE]), |
| 294 | atomic_read(&failed[SMB2_SESSION_SETUP_HE])); | 313 | atomic_read(&failed[SMB2_SESSION_SETUP_HE])); |
| 295 | #define SMB2LOGOFF 0x0002 /* trivial request/resp */ | ||
| 296 | seq_printf(m, "\nLogoffs: %d sent %d failed", | 314 | seq_printf(m, "\nLogoffs: %d sent %d failed", |
| 297 | atomic_read(&sent[SMB2_LOGOFF_HE]), | 315 | atomic_read(&sent[SMB2_LOGOFF_HE]), |
| 298 | atomic_read(&failed[SMB2_LOGOFF_HE])); | 316 | atomic_read(&failed[SMB2_LOGOFF_HE])); |
| @@ -645,6 +663,7 @@ struct smb_version_operations smb30_operations = { | |||
| 645 | .dump_detail = smb2_dump_detail, | 663 | .dump_detail = smb2_dump_detail, |
| 646 | .clear_stats = smb2_clear_stats, | 664 | .clear_stats = smb2_clear_stats, |
| 647 | .print_stats = smb2_print_stats, | 665 | .print_stats = smb2_print_stats, |
| 666 | .dump_share_caps = smb2_dump_share_caps, | ||
| 648 | .is_oplock_break = smb2_is_valid_oplock_break, | 667 | .is_oplock_break = smb2_is_valid_oplock_break, |
| 649 | .need_neg = smb2_need_neg, | 668 | .need_neg = smb2_need_neg, |
| 650 | .negotiate = smb2_negotiate, | 669 | .negotiate = smb2_negotiate, |
| @@ -690,6 +709,7 @@ struct smb_version_operations smb30_operations = { | |||
| 690 | .get_lease_key = smb2_get_lease_key, | 709 | .get_lease_key = smb2_get_lease_key, |
| 691 | .set_lease_key = smb2_set_lease_key, | 710 | .set_lease_key = smb2_set_lease_key, |
| 692 | .new_lease_key = smb2_new_lease_key, | 711 | .new_lease_key = smb2_new_lease_key, |
| 712 | .generate_signingkey = generate_smb3signingkey, | ||
| 693 | .calc_signature = smb3_calc_signature, | 713 | .calc_signature = smb3_calc_signature, |
| 694 | }; | 714 | }; |
| 695 | 715 | ||
| @@ -709,6 +729,8 @@ struct smb_version_values smb20_values = { | |||
| 709 | .cap_nt_find = SMB2_NT_FIND, | 729 | .cap_nt_find = SMB2_NT_FIND, |
| 710 | .cap_large_files = SMB2_LARGE_FILES, | 730 | .cap_large_files = SMB2_LARGE_FILES, |
| 711 | .oplock_read = SMB2_OPLOCK_LEVEL_II, | 731 | .oplock_read = SMB2_OPLOCK_LEVEL_II, |
| 732 | .signing_enabled = SMB2_NEGOTIATE_SIGNING_ENABLED | SMB2_NEGOTIATE_SIGNING_REQUIRED, | ||
| 733 | .signing_required = SMB2_NEGOTIATE_SIGNING_REQUIRED, | ||
| 712 | }; | 734 | }; |
| 713 | 735 | ||
| 714 | struct smb_version_values smb21_values = { | 736 | struct smb_version_values smb21_values = { |
| @@ -727,6 +749,8 @@ struct smb_version_values smb21_values = { | |||
| 727 | .cap_nt_find = SMB2_NT_FIND, | 749 | .cap_nt_find = SMB2_NT_FIND, |
| 728 | .cap_large_files = SMB2_LARGE_FILES, | 750 | .cap_large_files = SMB2_LARGE_FILES, |
| 729 | .oplock_read = SMB2_OPLOCK_LEVEL_II, | 751 | .oplock_read = SMB2_OPLOCK_LEVEL_II, |
| 752 | .signing_enabled = SMB2_NEGOTIATE_SIGNING_ENABLED | SMB2_NEGOTIATE_SIGNING_REQUIRED, | ||
| 753 | .signing_required = SMB2_NEGOTIATE_SIGNING_REQUIRED, | ||
| 730 | }; | 754 | }; |
| 731 | 755 | ||
| 732 | struct smb_version_values smb30_values = { | 756 | struct smb_version_values smb30_values = { |
| @@ -745,4 +769,26 @@ struct smb_version_values smb30_values = { | |||
| 745 | .cap_nt_find = SMB2_NT_FIND, | 769 | .cap_nt_find = SMB2_NT_FIND, |
| 746 | .cap_large_files = SMB2_LARGE_FILES, | 770 | .cap_large_files = SMB2_LARGE_FILES, |
| 747 | .oplock_read = SMB2_OPLOCK_LEVEL_II, | 771 | .oplock_read = SMB2_OPLOCK_LEVEL_II, |
| 772 | .signing_enabled = SMB2_NEGOTIATE_SIGNING_ENABLED | SMB2_NEGOTIATE_SIGNING_REQUIRED, | ||
| 773 | .signing_required = SMB2_NEGOTIATE_SIGNING_REQUIRED, | ||
| 774 | }; | ||
| 775 | |||
| 776 | struct smb_version_values smb302_values = { | ||
| 777 | .version_string = SMB302_VERSION_STRING, | ||
| 778 | .protocol_id = SMB302_PROT_ID, | ||
| 779 | .req_capabilities = SMB2_GLOBAL_CAP_DFS | SMB2_GLOBAL_CAP_LEASING | SMB2_GLOBAL_CAP_LARGE_MTU, | ||
| 780 | .large_lock_type = 0, | ||
| 781 | .exclusive_lock_type = SMB2_LOCKFLAG_EXCLUSIVE_LOCK, | ||
| 782 | .shared_lock_type = SMB2_LOCKFLAG_SHARED_LOCK, | ||
| 783 | .unlock_lock_type = SMB2_LOCKFLAG_UNLOCK, | ||
| 784 | .header_size = sizeof(struct smb2_hdr), | ||
| 785 | .max_header_size = MAX_SMB2_HDR_SIZE, | ||
| 786 | .read_rsp_size = sizeof(struct smb2_read_rsp) - 1, | ||
| 787 | .lock_cmd = SMB2_LOCK, | ||
| 788 | .cap_unix = 0, | ||
| 789 | .cap_nt_find = SMB2_NT_FIND, | ||
| 790 | .cap_large_files = SMB2_LARGE_FILES, | ||
| 791 | .oplock_read = SMB2_OPLOCK_LEVEL_II, | ||
| 792 | .signing_enabled = SMB2_NEGOTIATE_SIGNING_ENABLED | SMB2_NEGOTIATE_SIGNING_REQUIRED, | ||
| 793 | .signing_required = SMB2_NEGOTIATE_SIGNING_REQUIRED, | ||
| 748 | }; | 794 | }; |
