diff options
author | Steve French <smfrench@gmail.com> | 2013-10-14 16:27:32 -0400 |
---|---|---|
committer | Steve French <smfrench@gmail.com> | 2013-11-02 13:52:44 -0400 |
commit | c7f508a99bf229963915e79a603e0618d1d2ba76 (patch) | |
tree | b2eaa3a16ccafe2aa1d28130edaa552dd900f66c /fs/cifs/cifspdu.h | |
parent | af6a12ea8d4bb39a87527835b943bde4215897e5 (diff) |
Allow setting per-file compression via CIFS protocol
An earlier patch allowed setting the per-file compression flag
"chattr +c filename"
on an smb2 or smb3 mount, and also allowed lsattr to return
whether a file on a cifs, or smb2/smb3 mount was compressed.
This patch extends the ability to set the per-file
compression flag to the cifs protocol, which uses a somewhat
different IOCTL mechanism than SMB2, although the payload
(the flags stored in the compression_state) are the same.
Reviewed-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <smfrench@gmail.com>
Diffstat (limited to 'fs/cifs/cifspdu.h')
-rw-r--r-- | fs/cifs/cifspdu.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/fs/cifs/cifspdu.h b/fs/cifs/cifspdu.h index f80f98f5ef9c..9e5ee34de986 100644 --- a/fs/cifs/cifspdu.h +++ b/fs/cifs/cifspdu.h | |||
@@ -1352,6 +1352,35 @@ typedef struct smb_com_transaction_ioctl_req { | |||
1352 | __u8 Data[1]; | 1352 | __u8 Data[1]; |
1353 | } __attribute__((packed)) TRANSACT_IOCTL_REQ; | 1353 | } __attribute__((packed)) TRANSACT_IOCTL_REQ; |
1354 | 1354 | ||
1355 | typedef struct smb_com_transaction_compr_ioctl_req { | ||
1356 | struct smb_hdr hdr; /* wct = 23 */ | ||
1357 | __u8 MaxSetupCount; | ||
1358 | __u16 Reserved; | ||
1359 | __le32 TotalParameterCount; | ||
1360 | __le32 TotalDataCount; | ||
1361 | __le32 MaxParameterCount; | ||
1362 | __le32 MaxDataCount; | ||
1363 | __le32 ParameterCount; | ||
1364 | __le32 ParameterOffset; | ||
1365 | __le32 DataCount; | ||
1366 | __le32 DataOffset; | ||
1367 | __u8 SetupCount; /* four setup words follow subcommand */ | ||
1368 | /* SNIA spec incorrectly included spurious pad here */ | ||
1369 | __le16 SubCommand; /* 2 = IOCTL/FSCTL */ | ||
1370 | __le32 FunctionCode; | ||
1371 | __u16 Fid; | ||
1372 | __u8 IsFsctl; /* 1 = File System Control 0 = device control (IOCTL) */ | ||
1373 | __u8 IsRootFlag; /* 1 = apply command to root of share (must be DFS) */ | ||
1374 | __le16 ByteCount; | ||
1375 | __u8 Pad[3]; | ||
1376 | __le16 compression_state; /* See below for valid flags */ | ||
1377 | } __attribute__((packed)) TRANSACT_COMPR_IOCTL_REQ; | ||
1378 | |||
1379 | /* compression state flags */ | ||
1380 | #define COMPRESSION_FORMAT_NONE 0x0000 | ||
1381 | #define COMPRESSION_FORMAT_DEFAULT 0x0001 | ||
1382 | #define COMPRESSION_FORMAT_LZNT1 0x0002 | ||
1383 | |||
1355 | typedef struct smb_com_transaction_ioctl_rsp { | 1384 | typedef struct smb_com_transaction_ioctl_rsp { |
1356 | struct smb_hdr hdr; /* wct = 19 */ | 1385 | struct smb_hdr hdr; /* wct = 19 */ |
1357 | __u8 Reserved[3]; | 1386 | __u8 Reserved[3]; |