Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

smb: move some definitions from common/smb2pdu.h into common/fscc.h

These definitions are specified in MS-FSCC, so move them into fscc.h.

Only add some documentation references, no other changes.

Signed-off-by: ZhangGuoDong <zhangguodong@kylinos.cn>
Reviewed-by: ChenXiaoSong <chenxiaosong@kylinos.cn>
Reviewed-by: Steve French <stfrench@microsoft.com>
Acked-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>

authored by

ZhangGuoDong and committed by
Steve French
a5e58109 028ef9c9

+315 -307
+315
fs/smb/common/fscc.h
··· 12 12 #ifndef _COMMON_SMB_FSCC_H 13 13 #define _COMMON_SMB_FSCC_H 14 14 15 + /* Reparse structures - see MS-FSCC 2.1.2 */ 16 + 17 + /* struct fsctl_reparse_info_req is empty, only response structs (see below) */ 18 + struct reparse_data_buffer { 19 + __le32 ReparseTag; 20 + __le16 ReparseDataLength; 21 + __u16 Reserved; 22 + __u8 DataBuffer[]; /* Variable Length */ 23 + } __packed; 24 + 25 + struct reparse_guid_data_buffer { 26 + __le32 ReparseTag; 27 + __le16 ReparseDataLength; 28 + __u16 Reserved; 29 + __u8 ReparseGuid[16]; 30 + __u8 DataBuffer[]; /* Variable Length */ 31 + } __packed; 32 + 33 + struct reparse_mount_point_data_buffer { 34 + __le32 ReparseTag; 35 + __le16 ReparseDataLength; 36 + __u16 Reserved; 37 + __le16 SubstituteNameOffset; 38 + __le16 SubstituteNameLength; 39 + __le16 PrintNameOffset; 40 + __le16 PrintNameLength; 41 + __u8 PathBuffer[]; /* Variable Length */ 42 + } __packed; 43 + 44 + #define SYMLINK_FLAG_RELATIVE 0x00000001 45 + 46 + struct reparse_symlink_data_buffer { 47 + __le32 ReparseTag; 48 + __le16 ReparseDataLength; 49 + __u16 Reserved; 50 + __le16 SubstituteNameOffset; 51 + __le16 SubstituteNameLength; 52 + __le16 PrintNameOffset; 53 + __le16 PrintNameLength; 54 + __le32 Flags; 55 + __u8 PathBuffer[]; /* Variable Length */ 56 + } __packed; 57 + 58 + /* For IO_REPARSE_TAG_NFS - see MS-FSCC 2.1.2.6 */ 59 + #define NFS_SPECFILE_LNK 0x00000000014B4E4C 60 + #define NFS_SPECFILE_CHR 0x0000000000524843 61 + #define NFS_SPECFILE_BLK 0x00000000004B4C42 62 + #define NFS_SPECFILE_FIFO 0x000000004F464946 63 + #define NFS_SPECFILE_SOCK 0x000000004B434F53 64 + struct reparse_nfs_data_buffer { 65 + __le32 ReparseTag; 66 + __le16 ReparseDataLength; 67 + __u16 Reserved; 68 + __le64 InodeType; /* NFS_SPECFILE_* */ 69 + __u8 DataBuffer[]; 70 + } __packed; 71 + 72 + /* For IO_REPARSE_TAG_LX_SYMLINK - see MS-FSCC 2.1.2.7 */ 73 + struct reparse_wsl_symlink_data_buffer { 74 + __le32 ReparseTag; 75 + __le16 ReparseDataLength; 76 + __u16 Reserved; 77 + __le32 Version; /* Always 2 */ 78 + __u8 Target[]; /* Variable Length UTF-8 string without nul-term */ 79 + } __packed; 80 + 81 + /* See MS-FSCC 2.3.7 */ 82 + struct duplicate_extents_to_file { 83 + __u64 PersistentFileHandle; /* source file handle, opaque endianness */ 84 + __u64 VolatileFileHandle; 85 + __le64 SourceFileOffset; 86 + __le64 TargetFileOffset; 87 + __le64 ByteCount; /* Bytes to be copied */ 88 + } __packed; 89 + 90 + /* See MS-FSCC 2.3.9 */ 91 + #define DUPLICATE_EXTENTS_DATA_EX_SOURCE_ATOMIC 0x00000001 92 + struct duplicate_extents_to_file_ex { 93 + __le64 StructureSize; /* MUST be set to 0x30 */ 94 + __u64 PersistentFileHandle; /* source file handle, opaque endianness */ 95 + __u64 VolatileFileHandle; 96 + __le64 SourceFileOffset; 97 + __le64 TargetFileOffset; 98 + __le64 ByteCount; /* Bytes to be copied */ 99 + __le32 Flags; 100 + __le32 Reserved; 101 + } __packed; 102 + 103 + /* See MS-FSCC 2.3.20 */ 104 + struct fsctl_get_integrity_information_rsp { 105 + __le16 ChecksumAlgorithm; 106 + __le16 Reserved; 107 + __le32 Flags; 108 + __le32 ChecksumChunkSizeInBytes; 109 + __le32 ClusterSizeInBytes; 110 + } __packed; 111 + 112 + /* See MS-FSCC 2.3.52 */ 113 + struct file_allocated_range_buffer { 114 + __le64 file_offset; 115 + __le64 length; 116 + } __packed; 117 + 118 + /* See MS-FSCC 2.3.55 */ 119 + struct fsctl_query_file_regions_req { 120 + __le64 FileOffset; 121 + __le64 Length; 122 + __le32 DesiredUsage; 123 + __le32 Reserved; 124 + } __packed; 125 + 126 + /* DesiredUsage flags see MS-FSCC 2.3.56.1 */ 127 + #define FILE_USAGE_INVALID_RANGE 0x00000000 128 + #define FILE_USAGE_VALID_CACHED_DATA 0x00000001 129 + #define FILE_USAGE_NONCACHED_DATA 0x00000002 130 + struct file_region_info { 131 + __le64 FileOffset; 132 + __le64 Length; 133 + __le32 DesiredUsage; 134 + __le32 Reserved; 135 + } __packed; 136 + 137 + /* See MS-FSCC 2.3.56 */ 138 + struct fsctl_query_file_region_rsp { 139 + __le32 Flags; 140 + __le32 TotalRegionEntryCount; 141 + __le32 RegionEntryCount; 142 + __u32 Reserved; 143 + struct file_region_info Regions[]; 144 + } __packed; 145 + 146 + /* See MS-FSCC 2.3.58 */ 147 + struct fsctl_query_on_disk_vol_info_rsp { 148 + __le64 DirectoryCount; 149 + __le64 FileCount; 150 + __le16 FsFormatMajVersion; 151 + __le16 FsFormatMinVersion; 152 + __u8 FsFormatName[24]; 153 + __le64 FormatTime; 154 + __le64 LastUpdateTime; 155 + __u8 CopyrightInfo[68]; 156 + __u8 AbstractInfo[68]; 157 + __u8 FormatImplInfo[68]; 158 + __u8 LastModifyImplInfo[68]; 159 + } __packed; 160 + 161 + /* See MS-FSCC 2.3.73 */ 162 + struct fsctl_set_integrity_information_req { 163 + __le16 ChecksumAlgorithm; 164 + __le16 Reserved; 165 + __le32 Flags; 166 + } __packed; 167 + 168 + /* See MS-FSCC 2.3.75 */ 169 + struct fsctl_set_integrity_info_ex_req { 170 + __u8 EnableIntegrity; 171 + __u8 KeepState; 172 + __u16 Reserved; 173 + __le32 Flags; 174 + __u8 Version; 175 + __u8 Reserved2[7]; 176 + } __packed; 177 + 178 + /* 179 + * this goes in the ioctl buffer when doing FSCTL_SET_ZERO_DATA 180 + * See MS-FSCC 2.3.85 181 + */ 182 + struct file_zero_data_information { 183 + __le64 FileOffset; 184 + __le64 BeyondFinalZero; 185 + } __packed; 186 + 187 + /* 188 + * This level 18, although with struct with same name is different from cifs 189 + * level 0x107. Level 0x107 has an extra u64 between AccessFlags and 190 + * CurrentByteOffset. 191 + * See MS-FSCC 2.4.2 192 + */ 193 + struct smb2_file_all_info { /* data block encoding of response to level 18 */ 194 + __le64 CreationTime; /* Beginning of FILE_BASIC_INFO equivalent */ 195 + __le64 LastAccessTime; 196 + __le64 LastWriteTime; 197 + __le64 ChangeTime; 198 + __le32 Attributes; 199 + __u32 Pad1; /* End of FILE_BASIC_INFO_INFO equivalent */ 200 + __le64 AllocationSize; /* Beginning of FILE_STANDARD_INFO equivalent */ 201 + __le64 EndOfFile; /* size ie offset to first free byte in file */ 202 + __le32 NumberOfLinks; /* hard links */ 203 + __u8 DeletePending; 204 + __u8 Directory; 205 + __u16 Pad2; /* End of FILE_STANDARD_INFO equivalent */ 206 + __le64 IndexNumber; 207 + __le32 EASize; 208 + __le32 AccessFlags; 209 + __le64 CurrentByteOffset; 210 + __le32 Mode; 211 + __le32 AlignmentRequirement; 212 + __le32 FileNameLength; 213 + union { 214 + char __pad; /* Legacy structure padding */ 215 + DECLARE_FLEX_ARRAY(char, FileName); 216 + }; 217 + } __packed; /* level 18 Query */ 218 + 15 219 /* See MS-FSCC 2.4.8 */ 16 220 typedef struct { 17 221 __le32 NextEntryOffset; ··· 249 45 __le32 FileNameLength; 250 46 char FileName[]; 251 47 } __packed FILE_DIRECTORY_INFO; /* level 0x101 FF resp data */ 48 + 49 + /* See MS-FSCC 2.4.13 */ 50 + struct smb2_file_eof_info { /* encoding of request for level 10 */ 51 + __le64 EndOfFile; /* new end of file value */ 52 + } __packed; /* level 20 Set */ 252 53 253 54 /* See MS-FSCC 2.4.14 */ 254 55 typedef struct { ··· 289 80 char FileName[]; 290 81 } __packed FILE_ID_FULL_DIR_INFO; /* level 0x105 FF rsp data */ 291 82 83 + /* See MS-FSCC 2.4.27 */ 84 + struct smb2_file_internal_info { 85 + __le64 IndexNumber; 86 + } __packed; /* level 6 Query */ 87 + 88 + /* See MS-FSCC 2.4.28.2 */ 89 + struct smb2_file_link_info { /* encoding of request for level 11 */ 90 + /* New members MUST be added within the struct_group() macro below. */ 91 + __struct_group(smb2_file_link_info_hdr, __hdr, __packed, 92 + __u8 ReplaceIfExists; /* 1 = replace existing link with new */ 93 + /* 0 = fail if link already exists */ 94 + __u8 Reserved[7]; 95 + __u64 RootDirectory; /* MBZ for network operations (why says spec?) */ 96 + __le32 FileNameLength; 97 + ); 98 + char FileName[]; /* Name to be assigned to new link */ 99 + } __packed; /* level 11 Set */ 100 + static_assert(offsetof(struct smb2_file_link_info, FileName) == sizeof(struct smb2_file_link_info_hdr), 101 + "struct member likely outside of __struct_group()"); 102 + 292 103 /* See MS-FSCC 2.4.34 */ 293 104 struct smb2_file_network_open_info { 294 105 struct_group_attr(network_open_info, __packed, ··· 322 93 ); 323 94 __le32 Reserved; 324 95 } __packed; /* level 34 Query also similar returned in close rsp and open rsp */ 96 + 97 + /* See MS-FSCC 2.4.42.2 */ 98 + struct smb2_file_rename_info { /* encoding of request for level 10 */ 99 + /* New members MUST be added within the struct_group() macro below. */ 100 + __struct_group(smb2_file_rename_info_hdr, __hdr, __packed, 101 + __u8 ReplaceIfExists; /* 1 = replace existing target with new */ 102 + /* 0 = fail if target already exists */ 103 + __u8 Reserved[7]; 104 + __u64 RootDirectory; /* MBZ for network operations (why says spec?) */ 105 + __le32 FileNameLength; 106 + ); 107 + char FileName[]; /* New name to be assigned */ 108 + /* padding - overall struct size must be >= 24 so filename + pad >= 6 */ 109 + } __packed; /* level 10 Set */ 110 + static_assert(offsetof(struct smb2_file_rename_info, FileName) == sizeof(struct smb2_file_rename_info_hdr), 111 + "struct member likely outside of __struct_group()"); 112 + 113 + /* File System Information Classes */ 114 + /* See MS-FSCC 2.5 */ 115 + #define FS_VOLUME_INFORMATION 1 /* Query */ 116 + #define FS_LABEL_INFORMATION 2 /* Set */ 117 + #define FS_SIZE_INFORMATION 3 /* Query */ 118 + #define FS_DEVICE_INFORMATION 4 /* Query */ 119 + #define FS_ATTRIBUTE_INFORMATION 5 /* Query */ 120 + #define FS_CONTROL_INFORMATION 6 /* Query, Set */ 121 + #define FS_FULL_SIZE_INFORMATION 7 /* Query */ 122 + #define FS_OBJECT_ID_INFORMATION 8 /* Query, Set */ 123 + #define FS_DRIVER_PATH_INFORMATION 9 /* Query */ 124 + #define FS_SECTOR_SIZE_INFORMATION 11 /* SMB3 or later. Query */ 125 + /* See POSIX Extensions to MS-FSCC 2.3.1.1 */ 126 + #define FS_POSIX_INFORMATION 100 /* SMB3.1.1 POSIX. Query */ 325 127 326 128 /* See MS-FSCC 2.5.1 */ 327 129 #define MAX_FS_NAME_LEN 52 ··· 389 129 #define FILE_UNICODE_ON_DISK 0x00000004 390 130 #define FILE_CASE_PRESERVED_NAMES 0x00000002 391 131 #define FILE_CASE_SENSITIVE_SEARCH 0x00000001 132 + 133 + /* 134 + * File System Control Information 135 + * See MS-FSCC 2.5.2 136 + */ 137 + struct smb2_fs_control_info { 138 + __le64 FreeSpaceStartFiltering; 139 + __le64 FreeSpaceThreshold; 140 + __le64 FreeSpaceStopFiltering; 141 + __le64 DefaultQuotaThreshold; 142 + __le64 DefaultQuotaLimit; 143 + __le32 FileSystemControlFlags; 144 + __le32 Padding; 145 + } __packed; 146 + 147 + /* See MS-FSCC 2.5.4 */ 148 + struct smb2_fs_full_size_info { 149 + __le64 TotalAllocationUnits; 150 + __le64 CallerAvailableAllocationUnits; 151 + __le64 ActualAvailableAllocationUnits; 152 + __le32 SectorsPerAllocationUnit; 153 + __le32 BytesPerSector; 154 + } __packed; 155 + 156 + /* See MS-FSCC 2.5.7 */ 157 + #define SSINFO_FLAGS_ALIGNED_DEVICE 0x00000001 158 + #define SSINFO_FLAGS_PARTITION_ALIGNED_ON_DEVICE 0x00000002 159 + #define SSINFO_FLAGS_NO_SEEK_PENALTY 0x00000004 160 + #define SSINFO_FLAGS_TRIM_ENABLED 0x00000008 161 + /* sector size info struct */ 162 + struct smb3_fs_ss_info { 163 + __le32 LogicalBytesPerSector; 164 + __le32 PhysicalBytesPerSectorForAtomicity; 165 + __le32 PhysicalBytesPerSectorForPerf; 166 + __le32 FSEffPhysicalBytesPerSectorForAtomicity; 167 + __le32 Flags; 168 + __le32 ByteOffsetForSectorAlignment; 169 + __le32 ByteOffsetForPartitionAlignment; 170 + } __packed; 392 171 393 172 /* See MS-FSCC 2.5.8 */ 394 173 typedef struct { ··· 487 188 #define FILE_ATTRIBUTE_INTEGRITY_STREAM_LE cpu_to_le32(FILE_ATTRIBUTE_INTEGRITY_STREAM) 488 189 #define FILE_ATTRIBUTE_NO_SCRUB_DATA_LE cpu_to_le32(FILE_ATTRIBUTE_NO_SCRUB_DATA) 489 190 #define FILE_ATTRIBUTE_MASK_LE cpu_to_le32(FILE_ATTRIBUTE_MASK) 191 + 192 + /* 193 + * SMB2 Notify Action Flags 194 + * See MS-FSCC 2.7.1 195 + */ 196 + #define FILE_ACTION_ADDED 0x00000001 197 + #define FILE_ACTION_REMOVED 0x00000002 198 + #define FILE_ACTION_MODIFIED 0x00000003 199 + #define FILE_ACTION_RENAMED_OLD_NAME 0x00000004 200 + #define FILE_ACTION_RENAMED_NEW_NAME 0x00000005 201 + #define FILE_ACTION_ADDED_STREAM 0x00000006 202 + #define FILE_ACTION_REMOVED_STREAM 0x00000007 203 + #define FILE_ACTION_MODIFIED_STREAM 0x00000008 204 + #define FILE_ACTION_REMOVED_BY_DELETE 0x00000009 205 + #define FILE_ACTION_ID_NOT_TUNNELLED 0x0000000A 206 + #define FILE_ACTION_TUNNELLED_ID_COLLISION 0x0000000B 490 207 491 208 /* 492 209 * Response contains array of the following structures
-307
fs/smb/common/smb2pdu.h
··· 1006 1006 #define FILE_NOTIFY_CHANGE_STREAM_SIZE 0x00000400 1007 1007 #define FILE_NOTIFY_CHANGE_STREAM_WRITE 0x00000800 1008 1008 1009 - /* 1010 - * SMB2 Notify Action Flags 1011 - * See MS-FSCC 2.7.1 1012 - */ 1013 - #define FILE_ACTION_ADDED 0x00000001 1014 - #define FILE_ACTION_REMOVED 0x00000002 1015 - #define FILE_ACTION_MODIFIED 0x00000003 1016 - #define FILE_ACTION_RENAMED_OLD_NAME 0x00000004 1017 - #define FILE_ACTION_RENAMED_NEW_NAME 0x00000005 1018 - #define FILE_ACTION_ADDED_STREAM 0x00000006 1019 - #define FILE_ACTION_REMOVED_STREAM 0x00000007 1020 - #define FILE_ACTION_MODIFIED_STREAM 0x00000008 1021 - #define FILE_ACTION_REMOVED_BY_DELETE 0x00000009 1022 - #define FILE_ACTION_ID_NOT_TUNNELLED 0x0000000A 1023 - #define FILE_ACTION_TUNNELLED_ID_COLLISION 0x0000000B 1024 - 1025 1009 /* See MS-SMB2 2.2.35 */ 1026 1010 struct smb2_change_notify_req { 1027 1011 struct smb2_hdr hdr; ··· 1483 1499 }; 1484 1500 } __packed; 1485 1501 1486 - /* this goes in the ioctl buffer when doing FSCTL_SET_ZERO_DATA */ 1487 - struct file_zero_data_information { 1488 - __le64 FileOffset; 1489 - __le64 BeyondFinalZero; 1490 - } __packed; 1491 - 1492 - /* See MS-FSCC 2.3.7 */ 1493 - struct duplicate_extents_to_file { 1494 - __u64 PersistentFileHandle; /* source file handle, opaque endianness */ 1495 - __u64 VolatileFileHandle; 1496 - __le64 SourceFileOffset; 1497 - __le64 TargetFileOffset; 1498 - __le64 ByteCount; /* Bytes to be copied */ 1499 - } __packed; 1500 - 1501 - /* See MS-FSCC 2.3.9 */ 1502 - #define DUPLICATE_EXTENTS_DATA_EX_SOURCE_ATOMIC 0x00000001 1503 - struct duplicate_extents_to_file_ex { 1504 - __le64 StructureSize; /* MUST be set to 0x30 */ 1505 - __u64 PersistentFileHandle; /* source file handle, opaque endianness */ 1506 - __u64 VolatileFileHandle; 1507 - __le64 SourceFileOffset; 1508 - __le64 TargetFileOffset; 1509 - __le64 ByteCount; /* Bytes to be copied */ 1510 - __le32 Flags; 1511 - __le32 Reserved; 1512 - } __packed; 1513 - 1514 - 1515 - /* See MS-FSCC 2.3.20 */ 1516 - struct fsctl_get_integrity_information_rsp { 1517 - __le16 ChecksumAlgorithm; 1518 - __le16 Reserved; 1519 - __le32 Flags; 1520 - __le32 ChecksumChunkSizeInBytes; 1521 - __le32 ClusterSizeInBytes; 1522 - } __packed; 1523 - 1524 - /* See MS-FSCC 2.3.55 */ 1525 - struct fsctl_query_file_regions_req { 1526 - __le64 FileOffset; 1527 - __le64 Length; 1528 - __le32 DesiredUsage; 1529 - __le32 Reserved; 1530 - } __packed; 1531 - 1532 - /* DesiredUsage flags see MS-FSCC 2.3.56.1 */ 1533 - #define FILE_USAGE_INVALID_RANGE 0x00000000 1534 - #define FILE_USAGE_VALID_CACHED_DATA 0x00000001 1535 - #define FILE_USAGE_NONCACHED_DATA 0x00000002 1536 - 1537 - struct file_region_info { 1538 - __le64 FileOffset; 1539 - __le64 Length; 1540 - __le32 DesiredUsage; 1541 - __le32 Reserved; 1542 - } __packed; 1543 - 1544 - /* See MS-FSCC 2.3.56 */ 1545 - struct fsctl_query_file_region_rsp { 1546 - __le32 Flags; 1547 - __le32 TotalRegionEntryCount; 1548 - __le32 RegionEntryCount; 1549 - __u32 Reserved; 1550 - struct file_region_info Regions[]; 1551 - } __packed; 1552 - 1553 - /* See MS-FSCC 2.3.58 */ 1554 - struct fsctl_query_on_disk_vol_info_rsp { 1555 - __le64 DirectoryCount; 1556 - __le64 FileCount; 1557 - __le16 FsFormatMajVersion; 1558 - __le16 FsFormatMinVersion; 1559 - __u8 FsFormatName[24]; 1560 - __le64 FormatTime; 1561 - __le64 LastUpdateTime; 1562 - __u8 CopyrightInfo[68]; 1563 - __u8 AbstractInfo[68]; 1564 - __u8 FormatImplInfo[68]; 1565 - __u8 LastModifyImplInfo[68]; 1566 - } __packed; 1567 - 1568 - /* See MS-FSCC 2.3.73 */ 1569 - struct fsctl_set_integrity_information_req { 1570 - __le16 ChecksumAlgorithm; 1571 - __le16 Reserved; 1572 - __le32 Flags; 1573 - } __packed; 1574 - 1575 - /* See MS-FSCC 2.3.75 */ 1576 - struct fsctl_set_integrity_info_ex_req { 1577 - __u8 EnableIntegrity; 1578 - __u8 KeepState; 1579 - __u16 Reserved; 1580 - __le32 Flags; 1581 - __u8 Version; 1582 - __u8 Reserved2[7]; 1583 - } __packed; 1584 - 1585 1502 /* Integrity ChecksumAlgorithm choices for above */ 1586 1503 #define CHECKSUM_TYPE_NONE 0x0000 1587 1504 #define CHECKSUM_TYPE_CRC64 0x0002 ··· 1490 1605 1491 1606 /* Integrity flags for above */ 1492 1607 #define FSCTL_INTEGRITY_FLAG_CHECKSUM_ENFORCEMENT_OFF 0x00000001 1493 - 1494 - /* Reparse structures - see MS-FSCC 2.1.2 */ 1495 - 1496 - /* struct fsctl_reparse_info_req is empty, only response structs (see below) */ 1497 - struct reparse_data_buffer { 1498 - __le32 ReparseTag; 1499 - __le16 ReparseDataLength; 1500 - __u16 Reserved; 1501 - __u8 DataBuffer[]; /* Variable Length */ 1502 - } __packed; 1503 - 1504 - struct reparse_guid_data_buffer { 1505 - __le32 ReparseTag; 1506 - __le16 ReparseDataLength; 1507 - __u16 Reserved; 1508 - __u8 ReparseGuid[16]; 1509 - __u8 DataBuffer[]; /* Variable Length */ 1510 - } __packed; 1511 - 1512 - struct reparse_mount_point_data_buffer { 1513 - __le32 ReparseTag; 1514 - __le16 ReparseDataLength; 1515 - __u16 Reserved; 1516 - __le16 SubstituteNameOffset; 1517 - __le16 SubstituteNameLength; 1518 - __le16 PrintNameOffset; 1519 - __le16 PrintNameLength; 1520 - __u8 PathBuffer[]; /* Variable Length */ 1521 - } __packed; 1522 - 1523 - #define SYMLINK_FLAG_RELATIVE 0x00000001 1524 - 1525 - struct reparse_symlink_data_buffer { 1526 - __le32 ReparseTag; 1527 - __le16 ReparseDataLength; 1528 - __u16 Reserved; 1529 - __le16 SubstituteNameOffset; 1530 - __le16 SubstituteNameLength; 1531 - __le16 PrintNameOffset; 1532 - __le16 PrintNameLength; 1533 - __le32 Flags; 1534 - __u8 PathBuffer[]; /* Variable Length */ 1535 - } __packed; 1536 - 1537 - /* For IO_REPARSE_TAG_NFS - see MS-FSCC 2.1.2.6 */ 1538 - #define NFS_SPECFILE_LNK 0x00000000014B4E4C 1539 - #define NFS_SPECFILE_CHR 0x0000000000524843 1540 - #define NFS_SPECFILE_BLK 0x00000000004B4C42 1541 - #define NFS_SPECFILE_FIFO 0x000000004F464946 1542 - #define NFS_SPECFILE_SOCK 0x000000004B434F53 1543 - struct reparse_nfs_data_buffer { 1544 - __le32 ReparseTag; 1545 - __le16 ReparseDataLength; 1546 - __u16 Reserved; 1547 - __le64 InodeType; /* NFS_SPECFILE_* */ 1548 - __u8 DataBuffer[]; 1549 - } __packed; 1550 - 1551 - /* For IO_REPARSE_TAG_LX_SYMLINK - see MS-FSCC 2.1.2.7 */ 1552 - struct reparse_wsl_symlink_data_buffer { 1553 - __le32 ReparseTag; 1554 - __le16 ReparseDataLength; 1555 - __u16 Reserved; 1556 - __le32 Version; /* Always 2 */ 1557 - __u8 Target[]; /* Variable Length UTF-8 string without nul-term */ 1558 - } __packed; 1559 1608 1560 1609 struct validate_negotiate_info_req { 1561 1610 __le32 Capabilities; ··· 1610 1791 __u8 Buffer[]; 1611 1792 } __packed; 1612 1793 1613 - /* 1614 - * PDU query infolevel structure definitions 1615 - */ 1616 - 1617 - /* See MS-FSCC 2.3.52 */ 1618 - struct file_allocated_range_buffer { 1619 - __le64 file_offset; 1620 - __le64 length; 1621 - } __packed; 1622 - 1623 - struct smb2_file_internal_info { 1624 - __le64 IndexNumber; 1625 - } __packed; /* level 6 Query */ 1626 - 1627 - struct smb2_file_rename_info { /* encoding of request for level 10 */ 1628 - /* New members MUST be added within the struct_group() macro below. */ 1629 - __struct_group(smb2_file_rename_info_hdr, __hdr, __packed, 1630 - __u8 ReplaceIfExists; /* 1 = replace existing target with new */ 1631 - /* 0 = fail if target already exists */ 1632 - __u8 Reserved[7]; 1633 - __u64 RootDirectory; /* MBZ for network operations (why says spec?) */ 1634 - __le32 FileNameLength; 1635 - ); 1636 - char FileName[]; /* New name to be assigned */ 1637 - /* padding - overall struct size must be >= 24 so filename + pad >= 6 */ 1638 - } __packed; /* level 10 Set */ 1639 - static_assert(offsetof(struct smb2_file_rename_info, FileName) == sizeof(struct smb2_file_rename_info_hdr), 1640 - "struct member likely outside of __struct_group()"); 1641 - 1642 - struct smb2_file_link_info { /* encoding of request for level 11 */ 1643 - /* New members MUST be added within the struct_group() macro below. */ 1644 - __struct_group(smb2_file_link_info_hdr, __hdr, __packed, 1645 - __u8 ReplaceIfExists; /* 1 = replace existing link with new */ 1646 - /* 0 = fail if link already exists */ 1647 - __u8 Reserved[7]; 1648 - __u64 RootDirectory; /* MBZ for network operations (why says spec?) */ 1649 - __le32 FileNameLength; 1650 - ); 1651 - char FileName[]; /* Name to be assigned to new link */ 1652 - } __packed; /* level 11 Set */ 1653 - static_assert(offsetof(struct smb2_file_link_info, FileName) == sizeof(struct smb2_file_link_info_hdr), 1654 - "struct member likely outside of __struct_group()"); 1655 - 1656 - /* 1657 - * This level 18, although with struct with same name is different from cifs 1658 - * level 0x107. Level 0x107 has an extra u64 between AccessFlags and 1659 - * CurrentByteOffset. 1660 - */ 1661 - struct smb2_file_all_info { /* data block encoding of response to level 18 */ 1662 - __le64 CreationTime; /* Beginning of FILE_BASIC_INFO equivalent */ 1663 - __le64 LastAccessTime; 1664 - __le64 LastWriteTime; 1665 - __le64 ChangeTime; 1666 - __le32 Attributes; 1667 - __u32 Pad1; /* End of FILE_BASIC_INFO_INFO equivalent */ 1668 - __le64 AllocationSize; /* Beginning of FILE_STANDARD_INFO equivalent */ 1669 - __le64 EndOfFile; /* size ie offset to first free byte in file */ 1670 - __le32 NumberOfLinks; /* hard links */ 1671 - __u8 DeletePending; 1672 - __u8 Directory; 1673 - __u16 Pad2; /* End of FILE_STANDARD_INFO equivalent */ 1674 - __le64 IndexNumber; 1675 - __le32 EASize; 1676 - __le32 AccessFlags; 1677 - __le64 CurrentByteOffset; 1678 - __le32 Mode; 1679 - __le32 AlignmentRequirement; 1680 - __le32 FileNameLength; 1681 - union { 1682 - char __pad; /* Legacy structure padding */ 1683 - DECLARE_FLEX_ARRAY(char, FileName); 1684 - }; 1685 - } __packed; /* level 18 Query */ 1686 - 1687 - struct smb2_file_eof_info { /* encoding of request for level 10 */ 1688 - __le64 EndOfFile; /* new end of file value */ 1689 - } __packed; /* level 20 Set */ 1690 - 1691 1794 /* Level 100 query info */ 1692 1795 struct smb311_posix_qinfo { 1693 1796 __le64 CreationTime; ··· 1633 1892 * le32 filenamelength 1634 1893 * u8 filename[] 1635 1894 */ 1636 - } __packed; 1637 - 1638 - /* File System Information Classes */ 1639 - #define FS_VOLUME_INFORMATION 1 /* Query */ 1640 - #define FS_LABEL_INFORMATION 2 /* Set */ 1641 - #define FS_SIZE_INFORMATION 3 /* Query */ 1642 - #define FS_DEVICE_INFORMATION 4 /* Query */ 1643 - #define FS_ATTRIBUTE_INFORMATION 5 /* Query */ 1644 - #define FS_CONTROL_INFORMATION 6 /* Query, Set */ 1645 - #define FS_FULL_SIZE_INFORMATION 7 /* Query */ 1646 - #define FS_OBJECT_ID_INFORMATION 8 /* Query, Set */ 1647 - #define FS_DRIVER_PATH_INFORMATION 9 /* Query */ 1648 - #define FS_SECTOR_SIZE_INFORMATION 11 /* SMB3 or later. Query */ 1649 - #define FS_POSIX_INFORMATION 100 /* SMB3.1.1 POSIX. Query */ 1650 - 1651 - struct smb2_fs_full_size_info { 1652 - __le64 TotalAllocationUnits; 1653 - __le64 CallerAvailableAllocationUnits; 1654 - __le64 ActualAvailableAllocationUnits; 1655 - __le32 SectorsPerAllocationUnit; 1656 - __le32 BytesPerSector; 1657 - } __packed; 1658 - 1659 - #define SSINFO_FLAGS_ALIGNED_DEVICE 0x00000001 1660 - #define SSINFO_FLAGS_PARTITION_ALIGNED_ON_DEVICE 0x00000002 1661 - #define SSINFO_FLAGS_NO_SEEK_PENALTY 0x00000004 1662 - #define SSINFO_FLAGS_TRIM_ENABLED 0x00000008 1663 - 1664 - /* sector size info struct */ 1665 - struct smb3_fs_ss_info { 1666 - __le32 LogicalBytesPerSector; 1667 - __le32 PhysicalBytesPerSectorForAtomicity; 1668 - __le32 PhysicalBytesPerSectorForPerf; 1669 - __le32 FSEffPhysicalBytesPerSectorForAtomicity; 1670 - __le32 Flags; 1671 - __le32 ByteOffsetForSectorAlignment; 1672 - __le32 ByteOffsetForPartitionAlignment; 1673 - } __packed; 1674 - 1675 - /* File System Control Information */ 1676 - struct smb2_fs_control_info { 1677 - __le64 FreeSpaceStartFiltering; 1678 - __le64 FreeSpaceThreshold; 1679 - __le64 FreeSpaceStopFiltering; 1680 - __le64 DefaultQuotaThreshold; 1681 - __le64 DefaultQuotaLimit; 1682 - __le32 FileSystemControlFlags; 1683 - __le32 Padding; 1684 1895 } __packed; 1685 1896 1686 1897 /* volume info struct - see MS-FSCC 2.5.9 */