@@ -1244,6 +1244,106 @@ struct file_zero_data_information {
12441244 __le64 BeyondFinalZero ;
12451245} __packed ;
12461246
1247+ /* See MS-FSCC 2.3.7 */
1248+ struct duplicate_extents_to_file {
1249+ __u64 PersistentFileHandle ; /* source file handle, opaque endianness */
1250+ __u64 VolatileFileHandle ;
1251+ __le64 SourceFileOffset ;
1252+ __le64 TargetFileOffset ;
1253+ __le64 ByteCount ; /* Bytes to be copied */
1254+ } __packed ;
1255+
1256+ /* See MS-FSCC 2.3.8 */
1257+ #define DUPLICATE_EXTENTS_DATA_EX_SOURCE_ATOMIC 0x00000001
1258+ struct duplicate_extents_to_file_ex {
1259+ __u64 PersistentFileHandle ; /* source file handle, opaque endianness */
1260+ __u64 VolatileFileHandle ;
1261+ __le64 SourceFileOffset ;
1262+ __le64 TargetFileOffset ;
1263+ __le64 ByteCount ; /* Bytes to be copied */
1264+ __le32 Flags ;
1265+ __le32 Reserved ;
1266+ } __packed ;
1267+
1268+
1269+ /* See MS-FSCC 2.3.20 */
1270+ struct fsctl_get_integrity_information_rsp {
1271+ __le16 ChecksumAlgorithm ;
1272+ __le16 Reserved ;
1273+ __le32 Flags ;
1274+ __le32 ChecksumChunkSizeInBytes ;
1275+ __le32 ClusterSizeInBytes ;
1276+ } __packed ;
1277+
1278+ /* See MS-FSCC 2.3.55 */
1279+ struct fsctl_query_file_regions_req {
1280+ __le64 FileOffset ;
1281+ __le64 Length ;
1282+ __le32 DesiredUsage ;
1283+ __le32 Reserved ;
1284+ } __packed ;
1285+
1286+ /* DesiredUsage flags see MS-FSCC 2.3.56.1 */
1287+ #define FILE_USAGE_INVALID_RANGE 0x00000000
1288+ #define FILE_USAGE_VALID_CACHED_DATA 0x00000001
1289+ #define FILE_USAGE_NONCACHED_DATA 0x00000002
1290+
1291+ struct file_region_info {
1292+ __le64 FileOffset ;
1293+ __le64 Length ;
1294+ __le32 DesiredUsage ;
1295+ __le32 Reserved ;
1296+ } __packed ;
1297+
1298+ /* See MS-FSCC 2.3.56 */
1299+ struct fsctl_query_file_region_rsp {
1300+ __le32 Flags ;
1301+ __le32 TotalRegionEntryCount ;
1302+ __le32 RegionEntryCount ;
1303+ __u32 Reserved ;
1304+ struct file_region_info Regions [];
1305+ } __packed ;
1306+
1307+ /* See MS-FSCC 2.3.58 */
1308+ struct fsctl_query_on_disk_vol_info_rsp {
1309+ __le64 DirectoryCount ;
1310+ __le64 FileCount ;
1311+ __le16 FsFormatMajVersion ;
1312+ __le16 FsFormatMinVersion ;
1313+ __u8 FsFormatName [24 ];
1314+ __le64 FormatTime ;
1315+ __le64 LastUpdateTime ;
1316+ __u8 CopyrightInfo [68 ];
1317+ __u8 AbstractInfo [68 ];
1318+ __u8 FormatImplInfo [68 ];
1319+ __u8 LastModifyImplInfo [68 ];
1320+ } __packed ;
1321+
1322+ /* See MS-FSCC 2.3.73 */
1323+ struct fsctl_set_integrity_information_req {
1324+ __le16 ChecksumAlgorithm ;
1325+ __le16 Reserved ;
1326+ __le32 Flags ;
1327+ } __packed ;
1328+
1329+ /* See MS-FSCC 2.3.75 */
1330+ struct fsctl_set_integrity_info_ex_req {
1331+ __u8 EnableIntegrity ;
1332+ __u8 KeepState ;
1333+ __u16 Reserved ;
1334+ __le32 Flags ;
1335+ __u8 Version ;
1336+ __u8 Reserved2 [7 ];
1337+ } __packed ;
1338+
1339+ /* Integrity ChecksumAlgorithm choices for above */
1340+ #define CHECKSUM_TYPE_NONE 0x0000
1341+ #define CHECKSUM_TYPE_CRC64 0x0002
1342+ #define CHECKSUM_TYPE_UNCHANGED 0xFFFF /* set only */
1343+
1344+ /* Integrity flags for above */
1345+ #define FSCTL_INTEGRITY_FLAG_CHECKSUM_ENFORCEMENT_OFF 0x00000001
1346+
12471347/* Reparse structures - see MS-FSCC 2.1.2 */
12481348
12491349/* struct fsctl_reparse_info_req is empty, only response structs (see below) */
@@ -1304,13 +1404,6 @@ struct validate_negotiate_info_rsp {
13041404 __le16 Dialect ; /* Dialect in use for the connection */
13051405} __packed ;
13061406
1307- struct duplicate_extents_to_file {
1308- __u64 PersistentFileHandle ; /* source file handle, opaque endianness */
1309- __u64 VolatileFileHandle ;
1310- __le64 SourceFileOffset ;
1311- __le64 TargetFileOffset ;
1312- __le64 ByteCount ; /* Bytes to be copied */
1313- } __packed ;
13141407
13151408/* Possible InfoType values */
13161409#define SMB2_O_INFO_FILE 0x01
@@ -1419,6 +1512,7 @@ struct smb2_query_info_rsp {
14191512 * PDU query infolevel structure definitions
14201513 */
14211514
1515+ /* See MS-FSCC 2.3.52 */
14221516struct file_allocated_range_buffer {
14231517 __le64 file_offset ;
14241518 __le64 length ;
0 commit comments