Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 49f466bd authored by Ronnie Sahlberg's avatar Ronnie Sahlberg Committed by Steve French
Browse files

cifs: remove struct smb2_hdr



struct smb2_hdr is now just a wrapper for smb2_sync_hdr.
We can thus get rid of smb2_hdr completely and access the sync header directly.

Signed-off-by: default avatarRonnie Sahlberg <lsahlber@redhat.com>
Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
parent d81243c6
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -148,7 +148,7 @@ cifs_buf_get(void)
	 * SMB2 header is bigger than CIFS one - no problems to clean some
	 * more bytes for CIFS.
	 */
	size_t buf_size = sizeof(struct smb2_hdr);
	size_t buf_size = sizeof(struct smb2_sync_hdr);

	/*
	 * We could use negotiated size instead of max_msgsize -
+0 −5
Original line number Diff line number Diff line
@@ -61,9 +61,4 @@
/* Maximum buffer size value we can send with 1 credit */
#define SMB2_MAX_BUFFER_SIZE 65536

static inline struct smb2_sync_hdr *get_sync_hdr(void *buf)
{
	return &(((struct smb2_hdr *)buf)->sync_hdr);
}

#endif	/* _SMB2_GLOB_H */
+1 −1
Original line number Diff line number Diff line
@@ -2451,7 +2451,7 @@ smb2_print_status(__le32 status)
int
map_smb2_to_linux_error(char *buf, bool log_err)
{
	struct smb2_sync_hdr *shdr = get_sync_hdr(buf);
	struct smb2_sync_hdr *shdr = (struct smb2_sync_hdr *)buf;
	unsigned int i;
	int rc = -EIO;
	__le32 smb2err = shdr->Status;
+1 −1
Original line number Diff line number Diff line
@@ -716,7 +716,7 @@ smb2_cancelled_close_fid(struct work_struct *work)
int
smb2_handle_cancelled_mid(char *buffer, struct TCP_Server_Info *server)
{
	struct smb2_sync_hdr *sync_hdr = get_sync_hdr(buffer);
	struct smb2_sync_hdr *sync_hdr = (struct smb2_sync_hdr *)buffer;
	struct smb2_create_rsp *rsp = (struct smb2_create_rsp *)buffer;
	struct cifs_tcon *tcon;
	struct close_cancelled_open *cancelled;
+6 −6
Original line number Diff line number Diff line
@@ -123,7 +123,7 @@ smb2_get_credits_field(struct TCP_Server_Info *server, const int optype)
static unsigned int
smb2_get_credits(struct mid_q_entry *mid)
{
	struct smb2_sync_hdr *shdr = get_sync_hdr(mid->resp_buf);
	struct smb2_sync_hdr *shdr = (struct smb2_sync_hdr *)mid->resp_buf;

	return le16_to_cpu(shdr->CreditRequest);
}
@@ -190,7 +190,7 @@ static struct mid_q_entry *
smb2_find_mid(struct TCP_Server_Info *server, char *buf)
{
	struct mid_q_entry *mid;
	struct smb2_sync_hdr *shdr = get_sync_hdr(buf);
	struct smb2_sync_hdr *shdr = (struct smb2_sync_hdr *)buf;
	__u64 wire_mid = le64_to_cpu(shdr->MessageId);

	if (shdr->ProtocolId == SMB2_TRANSFORM_PROTO_NUM) {
@@ -215,7 +215,7 @@ static void
smb2_dump_detail(void *buf, struct TCP_Server_Info *server)
{
#ifdef CONFIG_CIFS_DEBUG2
	struct smb2_sync_hdr *shdr = get_sync_hdr(buf);
	struct smb2_sync_hdr *shdr = (struct smb2_sync_hdr *)buf;

	cifs_dbg(VFS, "Cmd: %d Err: 0x%x Flags: 0x%x Mid: %llu Pid: %d\n",
		 shdr->Command, shdr->Status, shdr->Flags, shdr->MessageId,
@@ -1303,7 +1303,7 @@ smb2_close_dir(const unsigned int xid, struct cifs_tcon *tcon,
static bool
smb2_is_status_pending(char *buf, struct TCP_Server_Info *server, int length)
{
	struct smb2_sync_hdr *shdr = get_sync_hdr(buf);
	struct smb2_sync_hdr *shdr = (struct smb2_sync_hdr *)buf;

	if (shdr->Status != STATUS_PENDING)
		return false;
@@ -1321,7 +1321,7 @@ smb2_is_status_pending(char *buf, struct TCP_Server_Info *server, int length)
static bool
smb2_is_session_expired(char *buf)
{
	struct smb2_sync_hdr *shdr = get_sync_hdr(buf);
	struct smb2_sync_hdr *shdr = (struct smb2_sync_hdr *)buf;

	if (shdr->Status != STATUS_NETWORK_SESSION_EXPIRED &&
	    shdr->Status != STATUS_USER_SESSION_DELETED)
@@ -2534,7 +2534,7 @@ handle_read_data(struct TCP_Server_Info *server, struct mid_q_entry *mid,
	unsigned int cur_page_idx;
	unsigned int pad_len;
	struct cifs_readdata *rdata = mid->callback_data;
	struct smb2_sync_hdr *shdr = get_sync_hdr(buf);
	struct smb2_sync_hdr *shdr = (struct smb2_sync_hdr *)buf;
	struct bio_vec *bvec = NULL;
	struct iov_iter iter;
	struct kvec iov;
Loading