Re: [PATCH v4 14/24] smb: move SEARCH_ID_FULL_DIR_INFO to common/smb1pdu.h

Namjae Jeon
2025-10-28T03:50:19Z

On Mon, Oct 27, 2025 at 4:15 PM <chenxiaosong.chenxiaosong@linux.dev> wrote:
>
> From: ChenXiaoSong <chenxiaosong@kylinos.cn>
>
> Rename "struct file_id_full_dir_info" to "SEARCH_ID_FULL_DIR_INFO",
> then move duplicate definitions to common header file.
>
> Signed-off-by: ChenXiaoSong <chenxiaosong@kylinos.cn>
> ---
> fs/smb/client/cifspdu.h | 17 -----------------
> fs/smb/common/smb1pdu.h | 18 ++++++++++++++++++
> fs/smb/server/smb2pdu.c | 14 +++++++-------
> fs/smb/server/smb_common.h | 17 -----------------
> 4 files changed, 25 insertions(+), 41 deletions(-)
>
> diff --git a/fs/smb/client/cifspdu.h b/fs/smb/client/cifspdu.h
> index 8aac0e04f9fd..d106c6850807 100644
> --- a/fs/smb/client/cifspdu.h
> +++ b/fs/smb/client/cifspdu.h
> @@ -2159,23 +2159,6 @@ typedef struct {
> };
> } __attribute__((packed)) FILE_UNIX_INFO; /* level 0x202 */
>
> -typedef struct {
> - __le32 NextEntryOffset;
> - __u32 FileIndex;
> - __le64 CreationTime;
> - __le64 LastAccessTime;
> - __le64 LastWriteTime;
> - __le64 ChangeTime;
> - __le64 EndOfFile;
> - __le64 AllocationSize;
> - __le32 ExtFileAttributes;
> - __le32 FileNameLength;
> - __le32 EaSize; /* EA size */
> - __le32 Reserved;
> - __le64 UniqueId; /* inode num - le since Samba puts ino in low 32 bit*/
> - char FileName[];
> -} __attribute__((packed)) SEARCH_ID_FULL_DIR_INFO; /* level 0x105 FF rsp data */
> -
> typedef struct {
> __u32 ResumeKey;
> __le16 CreationDate; /* SMB Date */
> diff --git a/fs/smb/common/smb1pdu.h b/fs/smb/common/smb1pdu.h
> index 0bc1e2373210..82331a8f70e8 100644
> --- a/fs/smb/common/smb1pdu.h
> +++ b/fs/smb/common/smb1pdu.h
> @@ -399,6 +399,24 @@ typedef struct {
> char FileName[];
> } __packed FILE_FULL_DIRECTORY_INFO; /* level 0x102 rsp data */
>
> +/* See MS-SMB 2.2.8.1.2 */
> +typedef struct {
> + __le32 NextEntryOffset;
> + __u32 FileIndex;
> + __le64 CreationTime;
> + __le64 LastAccessTime;
> + __le64 LastWriteTime;
> + __le64 ChangeTime;
> + __le64 EndOfFile;
> + __le64 AllocationSize;
> + __le32 ExtFileAttributes;
> + __le32 FileNameLength;
> + __le32 EaSize; /* EA size */
> + __le32 Reserved;
> + __le64 UniqueId; /* inode num - le since Samba puts ino in low 32 bit*/
> + char FileName[];
> +} __packed SEARCH_ID_FULL_DIR_INFO; /* level 0x105 FF rsp data */
Please check if this class name is defined in the fscc specification.
Thanks.