smb: client: insert compression check/call on write requests
authorEnzo Matsumiya <ematsumiya@suse.de>
Wed, 11 Sep 2024 21:10:24 +0000 (16:10 -0500)
committerSteve French <stfrench@microsoft.com>
Sun, 15 Sep 2024 15:42:44 +0000 (10:42 -0500)
commitf046d71e84e1e94cf23335129a27f5cfe3e8b75f
tree4c41776e0a88feca09343bfbcaddc42c0ce21b7d
parentd14bbfff259cadb5af84413658699159556da156
smb: client: insert compression check/call on write requests

On smb2_async_writev(), set CIFS_COMPRESS_REQ on request flags if
should_compress() returns true.

On smb_send_rqst() check the flags, and compress and send the request to
the server.

(*) If the compression fails with -EMSGSIZE (i.e. compressed size is >=
uncompressed size), the original uncompressed request is sent instead.

Signed-off-by: Enzo Matsumiya <ematsumiya@suse.de>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/smb/client/smb2pdu.c
fs/smb/client/transport.c