Skip to content

Commit 96721fd

Browse files
ChenXiaoSongsmfrench
authored andcommitted
smb: move create_durable_rsp_v2 to common/smb2pdu.h
Modify the following places: - some fields in "struct create_durable_v2_rsp" -> struct durable_context_v2_rsp - durable_reconnect_context_v2_rsp -> durable_context_v2_rsp - create_durable_v2_rsp -> create_durable_rsp_v2 Then move them 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 81a45de commit 96721fd

5 files changed

Lines changed: 19 additions & 19 deletions

File tree

fs/smb/client/smb2pdu.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -138,12 +138,6 @@ struct share_redirect_error_context_rsp {
138138
/* Flags */
139139
#define SMB2_DHANDLE_FLAG_PERSISTENT 0x00000002
140140

141-
/* See MS-SMB2 2.2.14.2.12 */
142-
struct durable_reconnect_context_v2_rsp {
143-
__le32 Timeout;
144-
__le32 Flags; /* see above DHANDLE_FLAG_PERSISTENT */
145-
} __packed;
146-
147141
/* See MS-SMB2 2.2.13.2.5 */
148142
struct crt_twarp_ctxt {
149143
struct create_context_hdr ccontext;

fs/smb/common/smb2pdu.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1320,6 +1320,18 @@ struct create_durable_handle_reconnect_v2 {
13201320
struct durable_reconnect_context_v2 dcontext;
13211321
} __packed;
13221322

1323+
/* See MS-SMB2 2.2.14.2.12 */
1324+
struct durable_context_v2_rsp {
1325+
__le32 Timeout;
1326+
__le32 Flags; /* see SMB2_DHANDLE_FLAG_PERSISTENT */
1327+
} __packed;
1328+
1329+
struct create_durable_rsp_v2 {
1330+
struct create_context_hdr ccontext;
1331+
__u8 Name[8];
1332+
struct durable_context_v2_rsp dcontext;
1333+
} __packed;
1334+
13231335
/* See MS-SMB2 2.2.14.2.5 */
13241336
struct create_mxac_rsp {
13251337
struct create_context_hdr ccontext;

fs/smb/server/oplock.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1617,9 +1617,9 @@ void create_durable_rsp_buf(char *cc)
16171617
*/
16181618
void create_durable_v2_rsp_buf(char *cc, struct ksmbd_file *fp)
16191619
{
1620-
struct create_durable_v2_rsp *buf;
1620+
struct create_durable_rsp_v2 *buf;
16211621

1622-
buf = (struct create_durable_v2_rsp *)cc;
1622+
buf = (struct create_durable_rsp_v2 *)cc;
16231623
memset(buf, 0, sizeof(struct create_durable_rsp));
16241624
buf->ccontext.DataOffset = cpu_to_le16(offsetof
16251625
(struct create_durable_rsp, Data));
@@ -1633,9 +1633,9 @@ void create_durable_v2_rsp_buf(char *cc, struct ksmbd_file *fp)
16331633
buf->Name[2] = '2';
16341634
buf->Name[3] = 'Q';
16351635

1636-
buf->Timeout = cpu_to_le32(fp->durable_timeout);
1636+
buf->dcontext.Timeout = cpu_to_le32(fp->durable_timeout);
16371637
if (fp->is_persistent)
1638-
buf->Flags = cpu_to_le32(SMB2_DHANDLE_FLAG_PERSISTENT);
1638+
buf->dcontext.Flags = cpu_to_le32(SMB2_DHANDLE_FLAG_PERSISTENT);
16391639
}
16401640

16411641
/**

fs/smb/server/smb2ops.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ static struct smb_version_values smb30_server_values = {
5959
.cap_large_files = SMB2_LARGE_FILES,
6060
.create_lease_size = sizeof(struct create_lease_v2),
6161
.create_durable_size = sizeof(struct create_durable_rsp),
62-
.create_durable_v2_size = sizeof(struct create_durable_v2_rsp),
62+
.create_durable_v2_size = sizeof(struct create_durable_rsp_v2),
6363
.create_mxac_size = sizeof(struct create_mxac_rsp),
6464
.create_disk_id_size = sizeof(struct create_disk_id_rsp),
6565
.create_posix_size = sizeof(struct create_posix_rsp),
@@ -86,7 +86,7 @@ static struct smb_version_values smb302_server_values = {
8686
.cap_large_files = SMB2_LARGE_FILES,
8787
.create_lease_size = sizeof(struct create_lease_v2),
8888
.create_durable_size = sizeof(struct create_durable_rsp),
89-
.create_durable_v2_size = sizeof(struct create_durable_v2_rsp),
89+
.create_durable_v2_size = sizeof(struct create_durable_rsp_v2),
9090
.create_mxac_size = sizeof(struct create_mxac_rsp),
9191
.create_disk_id_size = sizeof(struct create_disk_id_rsp),
9292
.create_posix_size = sizeof(struct create_posix_rsp),
@@ -113,7 +113,7 @@ static struct smb_version_values smb311_server_values = {
113113
.cap_large_files = SMB2_LARGE_FILES,
114114
.create_lease_size = sizeof(struct create_lease_v2),
115115
.create_durable_size = sizeof(struct create_durable_rsp),
116-
.create_durable_v2_size = sizeof(struct create_durable_v2_rsp),
116+
.create_durable_v2_size = sizeof(struct create_durable_rsp_v2),
117117
.create_mxac_size = sizeof(struct create_mxac_rsp),
118118
.create_disk_id_size = sizeof(struct create_disk_id_rsp),
119119
.create_posix_size = sizeof(struct create_posix_rsp),

fs/smb/server/smb2pdu.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -98,12 +98,6 @@ struct create_durable_rsp {
9898
/* See MS-SMB2 2.2.13.2.11 */
9999
/* Flags */
100100
#define SMB2_DHANDLE_FLAG_PERSISTENT 0x00000002
101-
struct create_durable_v2_rsp {
102-
struct create_context_hdr ccontext;
103-
__u8 Name[8];
104-
__le32 Timeout;
105-
__le32 Flags;
106-
} __packed;
107101

108102
/* equivalent of the contents of SMB3.1.1 POSIX open context response */
109103
struct create_posix_rsp {

0 commit comments

Comments
 (0)