diff options
author | Enzo Matsumiya <ematsumiya@suse.de> | 2024-02-23 11:58:57 -0300 |
---|---|---|
committer | Steve French <stfrench@microsoft.com> | 2024-03-10 19:52:42 -0500 |
commit | 8fe7062b7d11fcd21c4dcb5f530eaa1a099b24e7 (patch) | |
tree | e18865670d456f31c3546d5401223de10c42a7eb /fs/smb/client/cifs_debug.c | |
parent | 073dd87c8e1ee55ca163956f0c71249dc28aac51 (diff) | |
download | linux-8fe7062b7d11fcd21c4dcb5f530eaa1a099b24e7.tar.gz linux-8fe7062b7d11fcd21c4dcb5f530eaa1a099b24e7.tar.bz2 linux-8fe7062b7d11fcd21c4dcb5f530eaa1a099b24e7.zip |
smb: client: negotiate compression algorithms
Change "compress=" mount option to a boolean flag, that, if set,
will enable negotiating compression algorithms with the server.
Do not de/compress anything for now.
Signed-off-by: Enzo Matsumiya <ematsumiya@suse.de>
Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'fs/smb/client/cifs_debug.c')
-rw-r--r-- | fs/smb/client/cifs_debug.c | 32 |
1 files changed, 26 insertions, 6 deletions
diff --git a/fs/smb/client/cifs_debug.c b/fs/smb/client/cifs_debug.c index 23d2622b969f..226d4835c92d 100644 --- a/fs/smb/client/cifs_debug.c +++ b/fs/smb/client/cifs_debug.c @@ -278,6 +278,24 @@ static int cifs_debug_files_proc_show(struct seq_file *m, void *v) return 0; } +static __always_inline const char *compression_alg_str(__le16 alg) +{ + switch (alg) { + case SMB3_COMPRESS_NONE: + return "NONE"; + case SMB3_COMPRESS_LZNT1: + return "LZNT1"; + case SMB3_COMPRESS_LZ77: + return "LZ77"; + case SMB3_COMPRESS_LZ77_HUFF: + return "LZ77-Huffman"; + case SMB3_COMPRESS_PATTERN: + return "Pattern_V1"; + default: + return "invalid"; + } +} + static int cifs_debug_data_proc_show(struct seq_file *m, void *v) { struct mid_q_entry *mid_entry; @@ -423,12 +441,6 @@ skip_rdma: server->echo_credits, server->oplock_credits, server->dialect); - if (server->compress_algorithm == SMB3_COMPRESS_LZNT1) - seq_printf(m, " COMPRESS_LZNT1"); - else if (server->compress_algorithm == SMB3_COMPRESS_LZ77) - seq_printf(m, " COMPRESS_LZ77"); - else if (server->compress_algorithm == SMB3_COMPRESS_LZ77_HUFF) - seq_printf(m, " COMPRESS_LZ77_HUFF"); if (server->sign) seq_printf(m, " signed"); if (server->posix_ext_supported) @@ -460,6 +472,14 @@ skip_rdma: server->leaf_fullpath); } + seq_puts(m, "\nCompression: "); + if (!server->compression.requested) + seq_puts(m, "disabled on mount"); + else if (server->compression.enabled) + seq_printf(m, "enabled (%s)", compression_alg_str(server->compression.alg)); + else + seq_puts(m, "disabled (not supported by this server)"); + seq_printf(m, "\n\n\tSessions: "); i = 0; list_for_each_entry(ses, &server->smb_ses_list, smb_ses_list) { |