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 file_basic_info into common/fscc.h

This struct definition is specified in MS-FSCC, so move them into fscc.h.

Modify the following places:

- smb2_file_basic_info -> file_basic_info
- Pad1 -> Pad

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

authored by

ZhangGuoDong and committed by
Steve French
31884d4b a5e58109

+17 -25
-9
fs/smb/client/smb1pdu.h
··· 2061 2061 __le32 EASize; 2062 2062 } __packed FILE_INFO_STANDARD; /* level 1 SetPath/FileInfo */ 2063 2063 2064 - typedef struct { 2065 - __le64 CreationTime; 2066 - __le64 LastAccessTime; 2067 - __le64 LastWriteTime; 2068 - __le64 ChangeTime; 2069 - __le32 Attributes; 2070 - __u32 Pad; 2071 - } __packed FILE_BASIC_INFO; /* size info, level 0x101 */ 2072 - 2073 2064 struct file_allocation_info { 2074 2065 __le64 AllocationSize; /* Note old Samba srvr rounds this up too much */ 2075 2066 } __packed; /* size used on disk, for level 0x103 for set, 0x105 for query */
+10
fs/smb/common/fscc.h
··· 216 216 }; 217 217 } __packed; /* level 18 Query */ 218 218 219 + /* See MS-FSCC 2.4.7 */ 220 + typedef struct file_basic_info { /* data block encoding of response to level 18 */ 221 + __le64 CreationTime; 222 + __le64 LastAccessTime; 223 + __le64 LastWriteTime; 224 + __le64 ChangeTime; 225 + __le32 Attributes; 226 + __u32 Pad; 227 + } __packed FILE_BASIC_INFO; /* size info, level 0x101 */ 228 + 219 229 /* See MS-FSCC 2.4.8 */ 220 230 typedef struct { 221 231 __le32 NextEntryOffset;
+7 -7
fs/smb/server/smb2pdu.c
··· 4858 4858 static int get_file_basic_info(struct smb2_query_info_rsp *rsp, 4859 4859 struct ksmbd_file *fp, void *rsp_org) 4860 4860 { 4861 - struct smb2_file_basic_info *basic_info; 4861 + struct file_basic_info *basic_info; 4862 4862 struct kstat stat; 4863 4863 u64 time; 4864 4864 int ret; ··· 4874 4874 if (ret) 4875 4875 return ret; 4876 4876 4877 - basic_info = (struct smb2_file_basic_info *)rsp->Buffer; 4877 + basic_info = (struct file_basic_info *)rsp->Buffer; 4878 4878 basic_info->CreationTime = cpu_to_le64(fp->create_time); 4879 4879 time = ksmbd_UnixTimeToNT(stat.atime); 4880 4880 basic_info->LastAccessTime = cpu_to_le64(time); ··· 4883 4883 time = ksmbd_UnixTimeToNT(stat.ctime); 4884 4884 basic_info->ChangeTime = cpu_to_le64(time); 4885 4885 basic_info->Attributes = fp->f_ci->m_fattr; 4886 - basic_info->Pad1 = 0; 4886 + basic_info->Pad = 0; 4887 4887 rsp->OutputBufferLength = 4888 - cpu_to_le32(sizeof(struct smb2_file_basic_info)); 4888 + cpu_to_le32(sizeof(struct file_basic_info)); 4889 4889 return 0; 4890 4890 } 4891 4891 ··· 6222 6222 } 6223 6223 6224 6224 static int set_file_basic_info(struct ksmbd_file *fp, 6225 - struct smb2_file_basic_info *file_info, 6225 + struct file_basic_info *file_info, 6226 6226 struct ksmbd_share_config *share) 6227 6227 { 6228 6228 struct iattr attrs; ··· 6504 6504 switch (req->FileInfoClass) { 6505 6505 case FILE_BASIC_INFORMATION: 6506 6506 { 6507 - if (buf_len < sizeof(struct smb2_file_basic_info)) 6507 + if (buf_len < sizeof(struct file_basic_info)) 6508 6508 return -EMSGSIZE; 6509 6509 6510 - return set_file_basic_info(fp, (struct smb2_file_basic_info *)buffer, share); 6510 + return set_file_basic_info(fp, (struct file_basic_info *)buffer, share); 6511 6511 } 6512 6512 case FILE_ALLOCATION_INFORMATION: 6513 6513 {
-9
fs/smb/server/smb2pdu.h
··· 186 186 __le32 AlignmentRequirement; 187 187 } __packed; 188 188 189 - struct smb2_file_basic_info { /* data block encoding of response to level 18 */ 190 - __le64 CreationTime; /* Beginning of FILE_BASIC_INFO equivalent */ 191 - __le64 LastAccessTime; 192 - __le64 LastWriteTime; 193 - __le64 ChangeTime; 194 - __le32 Attributes; 195 - __u32 Pad1; /* End of FILE_BASIC_INFO_INFO equivalent */ 196 - } __packed; 197 - 198 189 struct smb2_file_alt_name_info { 199 190 __le32 FileNameLength; 200 191 char FileName[];