Skip to content

Commit

Permalink
smb3: move some common open context structs to smbfs_common
Browse files Browse the repository at this point in the history
create durable and create durable reconnect context and the maximal
access create context struct definitions can be put in common code in
smbfs_common

Reviewed-by: Paulo Alcantara (SUSE) <pc@manguebit.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
  • Loading branch information
Steve French committed Apr 29, 2023
1 parent 1149c84 commit 2fe187d
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 36 deletions.
11 changes: 0 additions & 11 deletions fs/cifs/smb2pdu.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,17 +132,6 @@ struct share_redirect_error_context_rsp {
#define SMB2_LEASE_HANDLE_CACHING_HE 0x02
#define SMB2_LEASE_WRITE_CACHING_HE 0x04

struct create_durable {
struct create_context ccontext;
__u8 Name[8];
union {
__u8 Reserved[16];
struct {
__u64 PersistentFileId;
__u64 VolatileFileId;
} Fid;
} Data;
} __packed;

/* See MS-SMB2 2.2.13.2.11 */
/* Flags */
Expand Down
25 changes: 0 additions & 25 deletions fs/ksmbd/smb2pdu.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,18 +70,6 @@ struct create_durable_req_v2 {
__u8 CreateGuid[16];
} __packed;

struct create_durable_reconn_req {
struct create_context ccontext;
__u8 Name[8];
union {
__u8 Reserved[16];
struct {
__u64 PersistentFileId;
__u64 VolatileFileId;
} Fid;
} Data;
} __packed;

struct create_durable_reconn_v2_req {
struct create_context ccontext;
__u8 Name[8];
Expand Down Expand Up @@ -109,12 +97,6 @@ struct create_app_inst_id_vers {
__le64 AppInstanceVersionLow;
} __packed;

struct create_mxac_req {
struct create_context ccontext;
__u8 Name[8];
__le64 Timestamp;
} __packed;

struct create_alloc_size_req {
struct create_context ccontext;
__u8 Name[8];
Expand All @@ -137,13 +119,6 @@ struct create_durable_v2_rsp {
__le32 Flags;
} __packed;

struct create_mxac_rsp {
struct create_context ccontext;
__u8 Name[8];
__le32 QueryStatus;
__le32 MaximalAccess;
} __packed;

/* equivalent of the contents of SMB3.1.1 POSIX open context response */
struct create_posix_rsp {
struct create_context ccontext;
Expand Down
28 changes: 28 additions & 0 deletions fs/smbfs_common/smb2pdu.h
Original file line number Diff line number Diff line change
Expand Up @@ -1172,6 +1172,34 @@ struct create_posix {
__u32 Reserved;
} __packed;

/* See MS-SMB2 2.2.13.2.3 and MS-SMB2 2.2.13.2.4 */
struct create_durable {
struct create_context ccontext;
__u8 Name[8];
union {
__u8 Reserved[16];
struct {
__u64 PersistentFileId;
__u64 VolatileFileId;
} Fid;
} Data;
} __packed;

/* See MS-SMB2 2.2.13.2.5 */
struct create_mxac_req {
struct create_context ccontext;
__u8 Name[8];
__le64 Timestamp;
} __packed;

/* See MS-SMB2 2.2.14.2.5 */
struct create_mxac_rsp {
struct create_context ccontext;
__u8 Name[8];
__le32 QueryStatus;
__le32 MaximalAccess;
} __packed;

#define SMB2_LEASE_NONE_LE cpu_to_le32(0x00)
#define SMB2_LEASE_READ_CACHING_LE cpu_to_le32(0x01)
#define SMB2_LEASE_HANDLE_CACHING_LE cpu_to_le32(0x02)
Expand Down

0 comments on commit 2fe187d

Please sign in to comment.