Skip to content

Commit 464b913

Browse files
ChenXiaoSongsmfrench
authored andcommitted
smb: move FILE_SYSTEM_SIZE_INFO to common/fscc.h
Rename the following places: - struct filesystem_info -> FILE_SYSTEM_SIZE_INFO - FILE_SYSTEM_INFO -> FILE_SYSTEM_SIZE_INFO - FreeAllocationUnits -> AvailableAllocationUnits: consistent with MS-FSCC 2.5.8 Then 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>
1 parent d7edd38 commit 464b913

5 files changed

Lines changed: 14 additions & 20 deletions

File tree

fs/smb/client/cifspdu.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1982,13 +1982,6 @@ struct aliasInfo92 {
19821982
int shareNameOffset;
19831983
} __attribute__((packed));
19841984

1985-
typedef struct {
1986-
__le64 TotalAllocationUnits;
1987-
__le64 FreeAllocationUnits;
1988-
__le32 SectorsPerAllocationUnit;
1989-
__le32 BytesPerSector;
1990-
} __attribute__((packed)) FILE_SYSTEM_INFO; /* size info, level 0x103 */
1991-
19921985
typedef struct {
19931986
__le32 fsid;
19941987
__le32 SectorsPerAllocationUnit;

fs/smb/client/cifssmb.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4746,7 +4746,7 @@ CIFSSMBQFSInfo(const unsigned int xid, struct cifs_tcon *tcon,
47464746
/* level 0x103 SMB_QUERY_FILE_SYSTEM_INFO */
47474747
TRANSACTION2_QFSI_REQ *pSMB = NULL;
47484748
TRANSACTION2_QFSI_RSP *pSMBr = NULL;
4749-
FILE_SYSTEM_INFO *response_data;
4749+
FILE_SYSTEM_SIZE_INFO *response_data;
47504750
int rc = 0;
47514751
int bytes_returned = 0;
47524752
__u16 params, byte_count;
@@ -4794,7 +4794,7 @@ CIFSSMBQFSInfo(const unsigned int xid, struct cifs_tcon *tcon,
47944794
__u16 data_offset = le16_to_cpu(pSMBr->t2.DataOffset);
47954795

47964796
response_data =
4797-
(FILE_SYSTEM_INFO
4797+
(FILE_SYSTEM_SIZE_INFO
47984798
*) (((char *) &pSMBr->hdr.Protocol) +
47994799
data_offset);
48004800
FSData->f_bsize =
@@ -4811,7 +4811,7 @@ CIFSSMBQFSInfo(const unsigned int xid, struct cifs_tcon *tcon,
48114811
FSData->f_blocks =
48124812
le64_to_cpu(response_data->TotalAllocationUnits);
48134813
FSData->f_bfree = FSData->f_bavail =
4814-
le64_to_cpu(response_data->FreeAllocationUnits);
4814+
le64_to_cpu(response_data->AvailableAllocationUnits);
48154815
cifs_dbg(FYI, "Blocks: %lld Free: %lld Block size %ld\n",
48164816
(unsigned long long)FSData->f_blocks,
48174817
(unsigned long long)FSData->f_bfree,

fs/smb/common/fscc.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,14 @@ struct smb2_file_network_open_info {
121121
#define FILE_CASE_PRESERVED_NAMES 0x00000002
122122
#define FILE_CASE_SENSITIVE_SEARCH 0x00000001
123123

124+
/* See MS-FSCC 2.5.8 */
125+
typedef struct {
126+
__le64 TotalAllocationUnits;
127+
__le64 AvailableAllocationUnits;
128+
__le32 SectorsPerAllocationUnit;
129+
__le32 BytesPerSector;
130+
} __packed FILE_SYSTEM_SIZE_INFO; /* size info, level 0x103 */
131+
124132
/* See MS-FSCC 2.5.10 */
125133
typedef struct {
126134
__le32 DeviceType;

fs/smb/server/smb2pdu.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5536,11 +5536,11 @@ static int smb2_get_info_filesystem(struct ksmbd_work *work,
55365536
}
55375537
case FS_SIZE_INFORMATION:
55385538
{
5539-
struct filesystem_info *info;
5539+
FILE_SYSTEM_SIZE_INFO *info;
55405540

5541-
info = (struct filesystem_info *)(rsp->Buffer);
5541+
info = (FILE_SYSTEM_SIZE_INFO *)(rsp->Buffer);
55425542
info->TotalAllocationUnits = cpu_to_le64(stfs.f_blocks);
5543-
info->FreeAllocationUnits = cpu_to_le64(stfs.f_bfree);
5543+
info->AvailableAllocationUnits = cpu_to_le64(stfs.f_bfree);
55445544
info->SectorsPerAllocationUnit = cpu_to_le32(1);
55455545
info->BytesPerSector = cpu_to_le32(stfs.f_bsize);
55465546
rsp->OutputBufferLength = cpu_to_le32(24);

fs/smb/server/smb_common.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -112,13 +112,6 @@ struct filesystem_vol_info {
112112
__le16 VolumeLabel[];
113113
} __packed;
114114

115-
struct filesystem_info {
116-
__le64 TotalAllocationUnits;
117-
__le64 FreeAllocationUnits;
118-
__le32 SectorsPerAllocationUnit;
119-
__le32 BytesPerSector;
120-
} __packed; /* size info, level 0x103 */
121-
122115
#define EXTENDED_INFO_MAGIC 0x43667364 /* Cfsd */
123116
#define STRING_LENGTH 28
124117

0 commit comments

Comments
 (0)