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

smb: move some duplicate struct definitions to common/fscc.h

Modify the following places:

- smb2_file_ntwrk_info -> smb2_file_network_open_info
- struct filesystem_device_info -> FILE_SYSTEM_DEVICE_INFO
- struct file_directory_info -> FILE_DIRECTORY_INFO
- struct file_full_directory_info -> FILE_FULL_DIRECTORY_INFO
- struct file_both_directory_info -> FILE_BOTH_DIRECTORY_INFO
- struct file_id_full_dir_info -> FILE_ID_FULL_DIR_INFO
- struct filesystem_posix_info -> FILE_SYSTEM_POSIX_INFO

The fields of these structures are exactly the same on both client and
server, so move duplicate definitions to common header file.

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

authored by

ChenXiaoSong and committed by
Steve French
d7edd389 84d8d4cf

+156 -248
-91
fs/smb/client/cifspdu.h
··· 2036 2036 2037 2037 #define CIFS_POSIX_EXTENSIONS 0x00000010 /* support for new QFSInfo */ 2038 2038 2039 - typedef struct { 2040 - /* For undefined recommended transfer size return -1 in that field */ 2041 - __le32 OptimalTransferSize; /* bsize on some os, iosize on other os */ 2042 - __le32 BlockSize; 2043 - /* The next three fields are in terms of the block size. 2044 - (above). If block size is unknown, 4096 would be a 2045 - reasonable block size for a server to report. 2046 - Note that returning the blocks/blocksavail removes need 2047 - to make a second call (to QFSInfo level 0x103 to get this info. 2048 - UserBlockAvail is typically less than or equal to BlocksAvail, 2049 - if no distinction is made return the same value in each */ 2050 - __le64 TotalBlocks; 2051 - __le64 BlocksAvail; /* bfree */ 2052 - __le64 UserBlocksAvail; /* bavail */ 2053 - /* For undefined Node fields or FSID return -1 */ 2054 - __le64 TotalFileNodes; 2055 - __le64 FreeFileNodes; 2056 - __le64 FileSysIdentifier; /* fsid */ 2057 - /* NB Namelen comes from FILE_SYSTEM_ATTRIBUTE_INFO call */ 2058 - /* NB flags can come from FILE_SYSTEM_DEVICE_INFO call */ 2059 - } __attribute__((packed)) FILE_SYSTEM_POSIX_INFO; 2060 - 2061 2039 /* DeviceType Flags */ 2062 2040 #define FILE_DEVICE_CD_ROM 0x00000002 2063 2041 #define FILE_DEVICE_CD_ROM_FILE_SYSTEM 0x00000003 ··· 2069 2091 #define FILE_CHARACTERISTIC_WEBDAV_DEVICE 0x00002000 2070 2092 #define FILE_PORTABLE_DEVICE 0x00004000 2071 2093 #define FILE_DEVICE_ALLOW_APPCONTAINER_TRAVERSAL 0x00020000 2072 - 2073 - typedef struct { 2074 - __le32 DeviceType; 2075 - __le32 DeviceCharacteristics; 2076 - } __attribute__((packed)) FILE_SYSTEM_DEVICE_INFO; /* device info level 0x104 */ 2077 2094 2078 2095 /* minimum includes first three fields, and empty FS Name */ 2079 2096 #define MIN_FS_ATTR_INFO_SIZE 12 ··· 2304 2331 DECLARE_FLEX_ARRAY(char, FileName); 2305 2332 }; 2306 2333 } __attribute__((packed)) FILE_UNIX_INFO; /* level 0x202 */ 2307 - 2308 - typedef struct { 2309 - __le32 NextEntryOffset; 2310 - __u32 FileIndex; 2311 - __le64 CreationTime; 2312 - __le64 LastAccessTime; 2313 - __le64 LastWriteTime; 2314 - __le64 ChangeTime; 2315 - __le64 EndOfFile; 2316 - __le64 AllocationSize; 2317 - __le32 ExtFileAttributes; 2318 - __le32 FileNameLength; 2319 - char FileName[]; 2320 - } __attribute__((packed)) FILE_DIRECTORY_INFO; /* level 0x101 FF resp data */ 2321 - 2322 - typedef struct { 2323 - __le32 NextEntryOffset; 2324 - __u32 FileIndex; 2325 - __le64 CreationTime; 2326 - __le64 LastAccessTime; 2327 - __le64 LastWriteTime; 2328 - __le64 ChangeTime; 2329 - __le64 EndOfFile; 2330 - __le64 AllocationSize; 2331 - __le32 ExtFileAttributes; 2332 - __le32 FileNameLength; 2333 - __le32 EaSize; /* length of the xattrs */ 2334 - char FileName[]; 2335 - } __attribute__((packed)) FILE_FULL_DIRECTORY_INFO; /* level 0x102 rsp data */ 2336 - 2337 - typedef struct { 2338 - __le32 NextEntryOffset; 2339 - __u32 FileIndex; 2340 - __le64 CreationTime; 2341 - __le64 LastAccessTime; 2342 - __le64 LastWriteTime; 2343 - __le64 ChangeTime; 2344 - __le64 EndOfFile; 2345 - __le64 AllocationSize; 2346 - __le32 ExtFileAttributes; 2347 - __le32 FileNameLength; 2348 - __le32 EaSize; /* EA size */ 2349 - __le32 Reserved; 2350 - __le64 UniqueId; /* inode num - le since Samba puts ino in low 32 bit*/ 2351 - char FileName[]; 2352 - } __attribute__((packed)) SEARCH_ID_FULL_DIR_INFO; /* level 0x105 FF rsp data */ 2353 - 2354 - typedef struct { 2355 - __le32 NextEntryOffset; 2356 - __u32 FileIndex; 2357 - __le64 CreationTime; 2358 - __le64 LastAccessTime; 2359 - __le64 LastWriteTime; 2360 - __le64 ChangeTime; 2361 - __le64 EndOfFile; 2362 - __le64 AllocationSize; 2363 - __le32 ExtFileAttributes; 2364 - __le32 FileNameLength; 2365 - __le32 EaSize; /* length of the xattrs */ 2366 - __u8 ShortNameLength; 2367 - __u8 Reserved; 2368 - __u8 ShortName[24]; 2369 - char FileName[]; 2370 - } __attribute__((packed)) FILE_BOTH_DIRECTORY_INFO; /* level 0x104 FFrsp data */ 2371 2334 2372 2335 typedef struct { 2373 2336 __u32 ResumeKey;
+2 -2
fs/smb/client/inode.c
··· 1328 1328 /* for easier reading */ 1329 1329 FILE_ALL_INFO *fi; 1330 1330 FILE_DIRECTORY_INFO *fdi; 1331 - SEARCH_ID_FULL_DIR_INFO *si; 1331 + FILE_ID_FULL_DIR_INFO *si; 1332 1332 1333 1333 rc = cifs_backup_query_path_info(xid, tcon, sb, 1334 1334 full_path, ··· 1339 1339 1340 1340 move_cifs_info_to_smb2(&data->fi, fi); 1341 1341 fdi = (FILE_DIRECTORY_INFO *)fi; 1342 - si = (SEARCH_ID_FULL_DIR_INFO *)fi; 1342 + si = (FILE_ID_FULL_DIR_INFO *)fi; 1343 1343 1344 1344 cifs_dir_info_to_fattr(fattr, fdi, cifs_sb); 1345 1345 fattr->cf_uniqueid = le64_to_cpu(si->UniqueId);
+1 -1
fs/smb/client/readdir.c
··· 548 548 } 549 549 550 550 static void cifs_fill_dirent_search(struct cifs_dirent *de, 551 - const SEARCH_ID_FULL_DIR_INFO *info) 551 + const FILE_ID_FULL_DIR_INFO *info) 552 552 { 553 553 de->name = &info->FileName[0]; 554 554 de->namelen = le32_to_cpu(info->FileNameLength);
+1 -1
fs/smb/client/smb2pdu.c
··· 5454 5454 info_buf_size = sizeof(FILE_DIRECTORY_INFO); 5455 5455 break; 5456 5456 case SMB_FIND_FILE_ID_FULL_DIR_INFO: 5457 - info_buf_size = sizeof(SEARCH_ID_FULL_DIR_INFO); 5457 + info_buf_size = sizeof(FILE_ID_FULL_DIR_INFO); 5458 5458 break; 5459 5459 case SMB_FIND_FILE_POSIX_INFO: 5460 5460 /* note that posix payload are variable size */
-13
fs/smb/client/smb2pdu.h
··· 224 224 __le32 Tag; 225 225 } __packed; 226 226 227 - struct smb2_file_network_open_info { 228 - struct_group_attr(network_open_info, __packed, 229 - __le64 CreationTime; 230 - __le64 LastAccessTime; 231 - __le64 LastWriteTime; 232 - __le64 ChangeTime; 233 - __le64 AllocationSize; 234 - __le64 EndOfFile; 235 - __le32 Attributes; 236 - ); 237 - __le32 Reserved; 238 - } __packed; /* level 34 Query also similar returned in close rsp and open rsp */ 239 - 240 227 /* See MS-FSCC 2.4.21 */ 241 228 struct smb2_file_id_information { 242 229 __le64 VolumeSerialNumber;
+115
fs/smb/common/fscc.h
··· 12 12 #ifndef _COMMON_SMB_FSCC_H 13 13 #define _COMMON_SMB_FSCC_H 14 14 15 + /* See MS-FSCC 2.4.8 */ 16 + typedef struct { 17 + __le32 NextEntryOffset; 18 + __u32 FileIndex; 19 + __le64 CreationTime; 20 + __le64 LastAccessTime; 21 + __le64 LastWriteTime; 22 + __le64 ChangeTime; 23 + __le64 EndOfFile; 24 + __le64 AllocationSize; 25 + __le32 ExtFileAttributes; 26 + __le32 FileNameLength; 27 + __le32 EaSize; /* length of the xattrs */ 28 + __u8 ShortNameLength; 29 + __u8 Reserved; 30 + __u8 ShortName[24]; 31 + char FileName[]; 32 + } __packed FILE_BOTH_DIRECTORY_INFO; /* level 0x104 FFrsp data */ 33 + 34 + /* See MS-FSCC 2.4.10 */ 35 + typedef struct { 36 + __le32 NextEntryOffset; 37 + __u32 FileIndex; 38 + __le64 CreationTime; 39 + __le64 LastAccessTime; 40 + __le64 LastWriteTime; 41 + __le64 ChangeTime; 42 + __le64 EndOfFile; 43 + __le64 AllocationSize; 44 + __le32 ExtFileAttributes; 45 + __le32 FileNameLength; 46 + char FileName[]; 47 + } __packed FILE_DIRECTORY_INFO; /* level 0x101 FF resp data */ 48 + 49 + /* See MS-FSCC 2.4.14 */ 50 + typedef struct { 51 + __le32 NextEntryOffset; 52 + __u32 FileIndex; 53 + __le64 CreationTime; 54 + __le64 LastAccessTime; 55 + __le64 LastWriteTime; 56 + __le64 ChangeTime; 57 + __le64 EndOfFile; 58 + __le64 AllocationSize; 59 + __le32 ExtFileAttributes; 60 + __le32 FileNameLength; 61 + __le32 EaSize; /* length of the xattrs */ 62 + char FileName[]; 63 + } __packed FILE_FULL_DIRECTORY_INFO; /* level 0x102 rsp data */ 64 + 65 + /* See MS-FSCC 2.4.24 */ 66 + typedef struct { 67 + __le32 NextEntryOffset; 68 + __u32 FileIndex; 69 + __le64 CreationTime; 70 + __le64 LastAccessTime; 71 + __le64 LastWriteTime; 72 + __le64 ChangeTime; 73 + __le64 EndOfFile; 74 + __le64 AllocationSize; 75 + __le32 ExtFileAttributes; 76 + __le32 FileNameLength; 77 + __le32 EaSize; /* EA size */ 78 + __le32 Reserved; 79 + __le64 UniqueId; /* inode num - le since Samba puts ino in low 32 bit*/ 80 + char FileName[]; 81 + } __packed FILE_ID_FULL_DIR_INFO; /* level 0x105 FF rsp data */ 82 + 83 + /* See MS-FSCC 2.4.34 */ 84 + struct smb2_file_network_open_info { 85 + struct_group_attr(network_open_info, __packed, 86 + __le64 CreationTime; 87 + __le64 LastAccessTime; 88 + __le64 LastWriteTime; 89 + __le64 ChangeTime; 90 + __le64 AllocationSize; 91 + __le64 EndOfFile; 92 + __le32 Attributes; 93 + ); 94 + __le32 Reserved; 95 + } __packed; /* level 34 Query also similar returned in close rsp and open rsp */ 96 + 15 97 /* List of FileSystemAttributes - see MS-FSCC 2.5.1 */ 16 98 #define FILE_SUPPORTS_SPARSE_VDL 0x10000000 /* faster nonsparse extend */ 17 99 #define FILE_SUPPORTS_BLOCK_REFCOUNTING 0x08000000 /* allow ioctl dup extents */ ··· 120 38 #define FILE_UNICODE_ON_DISK 0x00000004 121 39 #define FILE_CASE_PRESERVED_NAMES 0x00000002 122 40 #define FILE_CASE_SENSITIVE_SEARCH 0x00000001 41 + 42 + /* See MS-FSCC 2.5.10 */ 43 + typedef struct { 44 + __le32 DeviceType; 45 + __le32 DeviceCharacteristics; 46 + } __packed FILE_SYSTEM_DEVICE_INFO; /* device info level 0x104 */ 47 + 48 + /* 49 + * See POSIX Extensions to MS-FSCC 2.3.2.1 50 + * Link: https://gitlab.com/samba-team/smb3-posix-spec/-/blob/master/fscc_posix_extensions.md 51 + */ 52 + typedef struct { 53 + /* For undefined recommended transfer size return -1 in that field */ 54 + __le32 OptimalTransferSize; /* bsize on some os, iosize on other os */ 55 + __le32 BlockSize; 56 + /* The next three fields are in terms of the block size. 57 + * (above). If block size is unknown, 4096 would be a 58 + * reasonable block size for a server to report. 59 + * Note that returning the blocks/blocksavail removes need 60 + * to make a second call (to QFSInfo level 0x103 to get this info. 61 + * UserBlockAvail is typically less than or equal to BlocksAvail, 62 + * if no distinction is made return the same value in each 63 + */ 64 + __le64 TotalBlocks; 65 + __le64 BlocksAvail; /* bfree */ 66 + __le64 UserBlocksAvail; /* bavail */ 67 + /* For undefined Node fields or FSID return -1 */ 68 + __le64 TotalFileNodes; 69 + __le64 FreeFileNodes; 70 + __le64 FileSysIdentifier; /* fsid */ 71 + /* NB Namelen comes from FILE_SYSTEM_ATTRIBUTE_INFO call */ 72 + /* NB flags can come from FILE_SYSTEM_DEVICE_INFO call */ 73 + } __packed FILE_SYSTEM_POSIX_INFO; 123 74 124 75 #endif /* _COMMON_SMB_FSCC_H */
+36 -36
fs/smb/server/smb2pdu.c
··· 3786 3786 { 3787 3787 switch (info_level) { 3788 3788 case FILE_FULL_DIRECTORY_INFORMATION: 3789 - return sizeof(struct file_full_directory_info); 3789 + return sizeof(FILE_FULL_DIRECTORY_INFO); 3790 3790 case FILE_BOTH_DIRECTORY_INFORMATION: 3791 - return sizeof(struct file_both_directory_info); 3791 + return sizeof(FILE_BOTH_DIRECTORY_INFO); 3792 3792 case FILE_DIRECTORY_INFORMATION: 3793 - return sizeof(struct file_directory_info); 3793 + return sizeof(FILE_DIRECTORY_INFO); 3794 3794 case FILE_NAMES_INFORMATION: 3795 3795 return sizeof(struct file_names_info); 3796 3796 case FILEID_FULL_DIRECTORY_INFORMATION: 3797 - return sizeof(struct file_id_full_dir_info); 3797 + return sizeof(FILE_ID_FULL_DIR_INFO); 3798 3798 case FILEID_BOTH_DIRECTORY_INFORMATION: 3799 3799 return sizeof(struct file_id_both_directory_info); 3800 3800 case SMB_FIND_FILE_POSIX_INFO: ··· 3809 3809 switch (info_level) { 3810 3810 case FILE_FULL_DIRECTORY_INFORMATION: 3811 3811 { 3812 - struct file_full_directory_info *ffdinfo; 3812 + FILE_FULL_DIRECTORY_INFO *ffdinfo; 3813 3813 3814 - ffdinfo = (struct file_full_directory_info *)d_info->rptr; 3814 + ffdinfo = (FILE_FULL_DIRECTORY_INFO *)d_info->rptr; 3815 3815 d_info->rptr += le32_to_cpu(ffdinfo->NextEntryOffset); 3816 3816 d_info->name = ffdinfo->FileName; 3817 3817 d_info->name_len = le32_to_cpu(ffdinfo->FileNameLength); ··· 3819 3819 } 3820 3820 case FILE_BOTH_DIRECTORY_INFORMATION: 3821 3821 { 3822 - struct file_both_directory_info *fbdinfo; 3822 + FILE_BOTH_DIRECTORY_INFO *fbdinfo; 3823 3823 3824 - fbdinfo = (struct file_both_directory_info *)d_info->rptr; 3824 + fbdinfo = (FILE_BOTH_DIRECTORY_INFO *)d_info->rptr; 3825 3825 d_info->rptr += le32_to_cpu(fbdinfo->NextEntryOffset); 3826 3826 d_info->name = fbdinfo->FileName; 3827 3827 d_info->name_len = le32_to_cpu(fbdinfo->FileNameLength); ··· 3829 3829 } 3830 3830 case FILE_DIRECTORY_INFORMATION: 3831 3831 { 3832 - struct file_directory_info *fdinfo; 3832 + FILE_DIRECTORY_INFO *fdinfo; 3833 3833 3834 - fdinfo = (struct file_directory_info *)d_info->rptr; 3834 + fdinfo = (FILE_DIRECTORY_INFO *)d_info->rptr; 3835 3835 d_info->rptr += le32_to_cpu(fdinfo->NextEntryOffset); 3836 3836 d_info->name = fdinfo->FileName; 3837 3837 d_info->name_len = le32_to_cpu(fdinfo->FileNameLength); ··· 3849 3849 } 3850 3850 case FILEID_FULL_DIRECTORY_INFORMATION: 3851 3851 { 3852 - struct file_id_full_dir_info *dinfo; 3852 + FILE_ID_FULL_DIR_INFO *dinfo; 3853 3853 3854 - dinfo = (struct file_id_full_dir_info *)d_info->rptr; 3854 + dinfo = (FILE_ID_FULL_DIR_INFO *)d_info->rptr; 3855 3855 d_info->rptr += le32_to_cpu(dinfo->NextEntryOffset); 3856 3856 d_info->name = dinfo->FileName; 3857 3857 d_info->name_len = le32_to_cpu(dinfo->FileNameLength); ··· 3934 3934 switch (info_level) { 3935 3935 case FILE_FULL_DIRECTORY_INFORMATION: 3936 3936 { 3937 - struct file_full_directory_info *ffdinfo; 3937 + FILE_FULL_DIRECTORY_INFO *ffdinfo; 3938 3938 3939 - ffdinfo = (struct file_full_directory_info *)kstat; 3939 + ffdinfo = (FILE_FULL_DIRECTORY_INFO *)kstat; 3940 3940 ffdinfo->FileNameLength = cpu_to_le32(conv_len); 3941 3941 ffdinfo->EaSize = 3942 3942 smb2_get_reparse_tag_special_file(ksmbd_kstat->kstat->mode); ··· 3950 3950 } 3951 3951 case FILE_BOTH_DIRECTORY_INFORMATION: 3952 3952 { 3953 - struct file_both_directory_info *fbdinfo; 3953 + FILE_BOTH_DIRECTORY_INFO *fbdinfo; 3954 3954 3955 - fbdinfo = (struct file_both_directory_info *)kstat; 3955 + fbdinfo = (FILE_BOTH_DIRECTORY_INFO *)kstat; 3956 3956 fbdinfo->FileNameLength = cpu_to_le32(conv_len); 3957 3957 fbdinfo->EaSize = 3958 3958 smb2_get_reparse_tag_special_file(ksmbd_kstat->kstat->mode); ··· 3968 3968 } 3969 3969 case FILE_DIRECTORY_INFORMATION: 3970 3970 { 3971 - struct file_directory_info *fdinfo; 3971 + FILE_DIRECTORY_INFO *fdinfo; 3972 3972 3973 - fdinfo = (struct file_directory_info *)kstat; 3973 + fdinfo = (FILE_DIRECTORY_INFO *)kstat; 3974 3974 fdinfo->FileNameLength = cpu_to_le32(conv_len); 3975 3975 if (d_info->hide_dot_file && d_info->name[0] == '.') 3976 3976 fdinfo->ExtFileAttributes |= FILE_ATTRIBUTE_HIDDEN_LE; ··· 3990 3990 } 3991 3991 case FILEID_FULL_DIRECTORY_INFORMATION: 3992 3992 { 3993 - struct file_id_full_dir_info *dinfo; 3993 + FILE_ID_FULL_DIR_INFO *dinfo; 3994 3994 3995 - dinfo = (struct file_id_full_dir_info *)kstat; 3995 + dinfo = (FILE_ID_FULL_DIR_INFO *)kstat; 3996 3996 dinfo->FileNameLength = cpu_to_le32(conv_len); 3997 3997 dinfo->EaSize = 3998 3998 smb2_get_reparse_tag_special_file(ksmbd_kstat->kstat->mode); ··· 4196 4196 switch (info_level) { 4197 4197 case FILE_FULL_DIRECTORY_INFORMATION: 4198 4198 { 4199 - struct file_full_directory_info *ffdinfo; 4199 + FILE_FULL_DIRECTORY_INFO *ffdinfo; 4200 4200 4201 - ffdinfo = (struct file_full_directory_info *)d_info->wptr; 4201 + ffdinfo = (FILE_FULL_DIRECTORY_INFO *)d_info->wptr; 4202 4202 memcpy(ffdinfo->FileName, d_info->name, d_info->name_len); 4203 4203 ffdinfo->FileName[d_info->name_len] = 0x00; 4204 4204 ffdinfo->FileNameLength = cpu_to_le32(d_info->name_len); ··· 4207 4207 } 4208 4208 case FILE_BOTH_DIRECTORY_INFORMATION: 4209 4209 { 4210 - struct file_both_directory_info *fbdinfo; 4210 + FILE_BOTH_DIRECTORY_INFO *fbdinfo; 4211 4211 4212 - fbdinfo = (struct file_both_directory_info *)d_info->wptr; 4212 + fbdinfo = (FILE_BOTH_DIRECTORY_INFO *)d_info->wptr; 4213 4213 memcpy(fbdinfo->FileName, d_info->name, d_info->name_len); 4214 4214 fbdinfo->FileName[d_info->name_len] = 0x00; 4215 4215 fbdinfo->FileNameLength = cpu_to_le32(d_info->name_len); ··· 4218 4218 } 4219 4219 case FILE_DIRECTORY_INFORMATION: 4220 4220 { 4221 - struct file_directory_info *fdinfo; 4221 + FILE_DIRECTORY_INFO *fdinfo; 4222 4222 4223 - fdinfo = (struct file_directory_info *)d_info->wptr; 4223 + fdinfo = (FILE_DIRECTORY_INFO *)d_info->wptr; 4224 4224 memcpy(fdinfo->FileName, d_info->name, d_info->name_len); 4225 4225 fdinfo->FileName[d_info->name_len] = 0x00; 4226 4226 fdinfo->FileNameLength = cpu_to_le32(d_info->name_len); ··· 4240 4240 } 4241 4241 case FILEID_FULL_DIRECTORY_INFORMATION: 4242 4242 { 4243 - struct file_id_full_dir_info *dinfo; 4243 + FILE_ID_FULL_DIR_INFO *dinfo; 4244 4244 4245 - dinfo = (struct file_id_full_dir_info *)d_info->wptr; 4245 + dinfo = (FILE_ID_FULL_DIR_INFO *)d_info->wptr; 4246 4246 memcpy(dinfo->FileName, d_info->name, d_info->name_len); 4247 4247 dinfo->FileName[d_info->name_len] = 0x00; 4248 4248 dinfo->FileNameLength = cpu_to_le32(d_info->name_len); ··· 4504 4504 goto err_out; 4505 4505 } else { 4506 4506 no_buf_len: 4507 - ((struct file_directory_info *) 4507 + ((FILE_DIRECTORY_INFO *) 4508 4508 ((char *)rsp->Buffer + d_info.last_entry_offset)) 4509 4509 ->NextEntryOffset = 0; 4510 4510 if (d_info.data_count >= d_info.last_entry_off_align) ··· 5123 5123 static int get_file_network_open_info(struct smb2_query_info_rsp *rsp, 5124 5124 struct ksmbd_file *fp, void *rsp_org) 5125 5125 { 5126 - struct smb2_file_ntwrk_info *file_info; 5126 + struct smb2_file_network_open_info *file_info; 5127 5127 struct kstat stat; 5128 5128 u64 time; 5129 5129 int ret; ··· 5139 5139 if (ret) 5140 5140 return ret; 5141 5141 5142 - file_info = (struct smb2_file_ntwrk_info *)rsp->Buffer; 5142 + file_info = (struct smb2_file_network_open_info *)rsp->Buffer; 5143 5143 5144 5144 file_info->CreationTime = cpu_to_le64(fp->create_time); 5145 5145 time = ksmbd_UnixTimeToNT(stat.atime); ··· 5158 5158 } 5159 5159 file_info->Reserved = cpu_to_le32(0); 5160 5160 rsp->OutputBufferLength = 5161 - cpu_to_le32(sizeof(struct smb2_file_ntwrk_info)); 5161 + cpu_to_le32(sizeof(struct smb2_file_network_open_info)); 5162 5162 return 0; 5163 5163 } 5164 5164 ··· 5466 5466 switch (fsinfoclass) { 5467 5467 case FS_DEVICE_INFORMATION: 5468 5468 { 5469 - struct filesystem_device_info *info; 5469 + FILE_SYSTEM_DEVICE_INFO *info; 5470 5470 5471 - info = (struct filesystem_device_info *)rsp->Buffer; 5471 + info = (FILE_SYSTEM_DEVICE_INFO *)rsp->Buffer; 5472 5472 5473 5473 info->DeviceType = cpu_to_le32(FILE_DEVICE_DISK); 5474 5474 info->DeviceCharacteristics = ··· 5623 5623 } 5624 5624 case FS_POSIX_INFORMATION: 5625 5625 { 5626 - struct filesystem_posix_info *info; 5626 + FILE_SYSTEM_POSIX_INFO *info; 5627 5627 5628 5628 if (!work->tcon->posix_extensions) { 5629 5629 pr_err("client doesn't negotiate with SMB3.1.1 POSIX Extensions\n"); 5630 5630 path_put(&path); 5631 5631 return -EOPNOTSUPP; 5632 5632 } else { 5633 - info = (struct filesystem_posix_info *)(rsp->Buffer); 5633 + info = (FILE_SYSTEM_POSIX_INFO *)(rsp->Buffer); 5634 5634 info->OptimalTransferSize = cpu_to_le32(stfs.f_bsize); 5635 5635 info->BlockSize = cpu_to_le32(stfs.f_bsize); 5636 5636 info->TotalBlocks = cpu_to_le64(stfs.f_blocks);
-11
fs/smb/server/smb2pdu.h
··· 217 217 char StreamName[]; 218 218 } __packed; 219 219 220 - struct smb2_file_ntwrk_info { 221 - __le64 CreationTime; 222 - __le64 LastAccessTime; 223 - __le64 LastWriteTime; 224 - __le64 ChangeTime; 225 - __le64 AllocationSize; 226 - __le64 EndOfFile; 227 - __le32 Attributes; 228 - __le32 Reserved; 229 - } __packed; 230 - 231 220 struct smb2_file_standard_info { 232 221 __le64 AllocationSize; 233 222 __le64 EndOfFile;
-92
fs/smb/server/smb_common.h
··· 104 104 __le16 FileSystemName[]; /* do not have to save this - get subset? */ 105 105 } __packed; 106 106 107 - struct filesystem_device_info { 108 - __le32 DeviceType; 109 - __le32 DeviceCharacteristics; 110 - } __packed; /* device info level 0x104 */ 111 - 112 107 struct filesystem_vol_info { 113 108 __le64 VolumeCreationTime; 114 109 __le32 SerialNumber; ··· 135 140 struct fs_extended_info extended_info; 136 141 } __packed; 137 142 138 - struct file_directory_info { 139 - __le32 NextEntryOffset; 140 - __u32 FileIndex; 141 - __le64 CreationTime; 142 - __le64 LastAccessTime; 143 - __le64 LastWriteTime; 144 - __le64 ChangeTime; 145 - __le64 EndOfFile; 146 - __le64 AllocationSize; 147 - __le32 ExtFileAttributes; 148 - __le32 FileNameLength; 149 - char FileName[]; 150 - } __packed; /* level 0x101 FF resp data */ 151 - 152 143 struct file_names_info { 153 144 __le32 NextEntryOffset; 154 145 __u32 FileIndex; 155 146 __le32 FileNameLength; 156 147 char FileName[]; 157 148 } __packed; /* level 0xc FF resp data */ 158 - 159 - struct file_full_directory_info { 160 - __le32 NextEntryOffset; 161 - __u32 FileIndex; 162 - __le64 CreationTime; 163 - __le64 LastAccessTime; 164 - __le64 LastWriteTime; 165 - __le64 ChangeTime; 166 - __le64 EndOfFile; 167 - __le64 AllocationSize; 168 - __le32 ExtFileAttributes; 169 - __le32 FileNameLength; 170 - __le32 EaSize; 171 - char FileName[]; 172 - } __packed; /* level 0x102 FF resp */ 173 - 174 - struct file_both_directory_info { 175 - __le32 NextEntryOffset; 176 - __u32 FileIndex; 177 - __le64 CreationTime; 178 - __le64 LastAccessTime; 179 - __le64 LastWriteTime; 180 - __le64 ChangeTime; 181 - __le64 EndOfFile; 182 - __le64 AllocationSize; 183 - __le32 ExtFileAttributes; 184 - __le32 FileNameLength; 185 - __le32 EaSize; /* length of the xattrs */ 186 - __u8 ShortNameLength; 187 - __u8 Reserved; 188 - __u8 ShortName[24]; 189 - char FileName[]; 190 - } __packed; /* level 0x104 FFrsp data */ 191 149 192 150 struct file_id_both_directory_info { 193 151 __le32 NextEntryOffset; ··· 160 212 __le16 Reserved2; 161 213 __le64 UniqueId; 162 214 char FileName[]; 163 - } __packed; 164 - 165 - struct file_id_full_dir_info { 166 - __le32 NextEntryOffset; 167 - __u32 FileIndex; 168 - __le64 CreationTime; 169 - __le64 LastAccessTime; 170 - __le64 LastWriteTime; 171 - __le64 ChangeTime; 172 - __le64 EndOfFile; 173 - __le64 AllocationSize; 174 - __le32 ExtFileAttributes; 175 - __le32 FileNameLength; 176 - __le32 EaSize; /* EA size */ 177 - __le32 Reserved; 178 - __le64 UniqueId; /* inode num - le since Samba puts ino in low 32 bit*/ 179 - char FileName[]; 180 - } __packed; /* level 0x105 FF rsp data */ 181 - 182 - struct filesystem_posix_info { 183 - /* For undefined recommended transfer size return -1 in that field */ 184 - __le32 OptimalTransferSize; /* bsize on some os, iosize on other os */ 185 - __le32 BlockSize; 186 - /* The next three fields are in terms of the block size. 187 - * (above). If block size is unknown, 4096 would be a 188 - * reasonable block size for a server to report. 189 - * Note that returning the blocks/blocksavail removes need 190 - * to make a second call (to QFSInfo level 0x103 to get this info. 191 - * UserBlockAvail is typically less than or equal to BlocksAvail, 192 - * if no distinction is made return the same value in each 193 - */ 194 - __le64 TotalBlocks; 195 - __le64 BlocksAvail; /* bfree */ 196 - __le64 UserBlocksAvail; /* bavail */ 197 - /* For undefined Node fields or FSID return -1 */ 198 - __le64 TotalFileNodes; 199 - __le64 FreeFileNodes; 200 - __le64 FileSysIdentifier; /* fsid */ 201 - /* NB Namelen comes from FILE_SYSTEM_ATTRIBUTE_INFO call */ 202 - /* NB flags can come from FILE_SYSTEM_DEVICE_INFO call */ 203 215 } __packed; 204 216 205 217 struct smb_version_ops {
+1 -1
fs/smb/server/vfs.c
··· 1657 1657 */ 1658 1658 void *ksmbd_vfs_init_kstat(char **p, struct ksmbd_kstat *ksmbd_kstat) 1659 1659 { 1660 - struct file_directory_info *info = (struct file_directory_info *)(*p); 1660 + FILE_DIRECTORY_INFO *info = (FILE_DIRECTORY_INFO *)(*p); 1661 1661 struct kstat *kstat = ksmbd_kstat->kstat; 1662 1662 u64 time; 1663 1663