Add various fsctl structs

Add missing structure definition for various newer fsctl operations
  - duplicate_extents_ex
  - get_integrity_information
  - query_file_regions
  - query_on_disk_volume_info

And move some fsctl defintions to smbfs_common

Signed-off-by: Steve French <stfrench@microsoft.com>
This commit is contained in:
Steve French 2022-05-22 21:14:42 -05:00
parent 22c5b91336
commit a42078b9e8
2 changed files with 101 additions and 29 deletions

View File

@ -260,28 +260,6 @@ struct get_retrieval_pointers_refcount_rsp {
struct smb3_extents extents[]; struct smb3_extents extents[];
} __packed; } __packed;
struct fsctl_set_integrity_information_req {
__le16 ChecksumAlgorithm;
__le16 Reserved;
__le32 Flags;
} __packed;
struct fsctl_get_integrity_information_rsp {
__le16 ChecksumAlgorithm;
__le16 Reserved;
__le32 Flags;
__le32 ChecksumChunkSizeInBytes;
__le32 ClusterSizeInBytes;
} __packed;
/* Integrity ChecksumAlgorithm choices for above */
#define CHECKSUM_TYPE_NONE 0x0000
#define CHECKSUM_TYPE_CRC64 0x0002
#define CHECKSUM_TYPE_UNCHANGED 0xFFFF /* set only */
/* Integrity flags for above */
#define FSCTL_INTEGRITY_FLAG_CHECKSUM_ENFORCEMENT_OFF 0x00000001
/* See MS-DFSC 2.2.2 */ /* See MS-DFSC 2.2.2 */
struct fsctl_get_dfs_referral_req { struct fsctl_get_dfs_referral_req {
__le16 MaxReferralLevel; __le16 MaxReferralLevel;

View File

@ -1244,6 +1244,106 @@ struct file_zero_data_information {
__le64 BeyondFinalZero; __le64 BeyondFinalZero;
} __packed; } __packed;
/* See MS-FSCC 2.3.7 */
struct duplicate_extents_to_file {
__u64 PersistentFileHandle; /* source file handle, opaque endianness */
__u64 VolatileFileHandle;
__le64 SourceFileOffset;
__le64 TargetFileOffset;
__le64 ByteCount; /* Bytes to be copied */
} __packed;
/* See MS-FSCC 2.3.8 */
#define DUPLICATE_EXTENTS_DATA_EX_SOURCE_ATOMIC 0x00000001
struct duplicate_extents_to_file_ex {
__u64 PersistentFileHandle; /* source file handle, opaque endianness */
__u64 VolatileFileHandle;
__le64 SourceFileOffset;
__le64 TargetFileOffset;
__le64 ByteCount; /* Bytes to be copied */
__le32 Flags;
__le32 Reserved;
} __packed;
/* See MS-FSCC 2.3.20 */
struct fsctl_get_integrity_information_rsp {
__le16 ChecksumAlgorithm;
__le16 Reserved;
__le32 Flags;
__le32 ChecksumChunkSizeInBytes;
__le32 ClusterSizeInBytes;
} __packed;
/* See MS-FSCC 2.3.55 */
struct fsctl_query_file_regions_req {
__le64 FileOffset;
__le64 Length;
__le32 DesiredUsage;
__le32 Reserved;
} __packed;
/* DesiredUsage flags see MS-FSCC 2.3.56.1 */
#define FILE_USAGE_INVALID_RANGE 0x00000000
#define FILE_USAGE_VALID_CACHED_DATA 0x00000001
#define FILE_USAGE_NONCACHED_DATA 0x00000002
struct file_region_info {
__le64 FileOffset;
__le64 Length;
__le32 DesiredUsage;
__le32 Reserved;
} __packed;
/* See MS-FSCC 2.3.56 */
struct fsctl_query_file_region_rsp {
__le32 Flags;
__le32 TotalRegionEntryCount;
__le32 RegionEntryCount;
__u32 Reserved;
struct file_region_info Regions[];
} __packed;
/* See MS-FSCC 2.3.58 */
struct fsctl_query_on_disk_vol_info_rsp {
__le64 DirectoryCount;
__le64 FileCount;
__le16 FsFormatMajVersion;
__le16 FsFormatMinVersion;
__u8 FsFormatName[24];
__le64 FormatTime;
__le64 LastUpdateTime;
__u8 CopyrightInfo[68];
__u8 AbstractInfo[68];
__u8 FormatImplInfo[68];
__u8 LastModifyImplInfo[68];
} __packed;
/* See MS-FSCC 2.3.73 */
struct fsctl_set_integrity_information_req {
__le16 ChecksumAlgorithm;
__le16 Reserved;
__le32 Flags;
} __packed;
/* See MS-FSCC 2.3.75 */
struct fsctl_set_integrity_info_ex_req {
__u8 EnableIntegrity;
__u8 KeepState;
__u16 Reserved;
__le32 Flags;
__u8 Version;
__u8 Reserved2[7];
} __packed;
/* Integrity ChecksumAlgorithm choices for above */
#define CHECKSUM_TYPE_NONE 0x0000
#define CHECKSUM_TYPE_CRC64 0x0002
#define CHECKSUM_TYPE_UNCHANGED 0xFFFF /* set only */
/* Integrity flags for above */
#define FSCTL_INTEGRITY_FLAG_CHECKSUM_ENFORCEMENT_OFF 0x00000001
/* Reparse structures - see MS-FSCC 2.1.2 */ /* Reparse structures - see MS-FSCC 2.1.2 */
/* struct fsctl_reparse_info_req is empty, only response structs (see below) */ /* struct fsctl_reparse_info_req is empty, only response structs (see below) */
@ -1304,13 +1404,6 @@ struct validate_negotiate_info_rsp {
__le16 Dialect; /* Dialect in use for the connection */ __le16 Dialect; /* Dialect in use for the connection */
} __packed; } __packed;
struct duplicate_extents_to_file {
__u64 PersistentFileHandle; /* source file handle, opaque endianness */
__u64 VolatileFileHandle;
__le64 SourceFileOffset;
__le64 TargetFileOffset;
__le64 ByteCount; /* Bytes to be copied */
} __packed;
/* Possible InfoType values */ /* Possible InfoType values */
#define SMB2_O_INFO_FILE 0x01 #define SMB2_O_INFO_FILE 0x01
@ -1419,6 +1512,7 @@ struct smb2_query_info_rsp {
* PDU query infolevel structure definitions * PDU query infolevel structure definitions
*/ */
/* See MS-FSCC 2.3.52 */
struct file_allocated_range_buffer { struct file_allocated_range_buffer {
__le64 file_offset; __le64 file_offset;
__le64 length; __le64 length;