diff options
author | Namjae Jeon <namjae.jeon@samsung.com> | 2021-06-25 07:43:37 +0300 |
---|---|---|
committer | Namjae Jeon <namjae.jeon@samsung.com> | 2021-06-29 09:06:03 +0300 |
commit | 8a893315dc06158ce33d1a3292e07170ce2fcd64 (patch) | |
tree | 3ba4187069b13cc25e54ac853d22998ec71397c6 /fs/ksmbd/ksmbd_work.h | |
parent | 02d4b4aa6d3b135b00f20da9d623d2bbae63768f (diff) | |
download | linux-8a893315dc06158ce33d1a3292e07170ce2fcd64.tar.xz |
ksmbd: replace request and respone buffer macro with inline functions
replace request and respone buffer macro with inline functions.
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'fs/ksmbd/ksmbd_work.h')
-rw-r--r-- | fs/ksmbd/ksmbd_work.h | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/fs/ksmbd/ksmbd_work.h b/fs/ksmbd/ksmbd_work.h index a91abd438a85..c655bf371ce5 100644 --- a/fs/ksmbd/ksmbd_work.h +++ b/fs/ksmbd/ksmbd_work.h @@ -86,10 +86,23 @@ struct ksmbd_work { struct list_head interim_entry; }; -#define RESPONSE_BUF_NEXT(w) \ - (((w)->response_buf + (w)->next_smb2_rsp_hdr_off)) -#define REQUEST_BUF_NEXT(w) \ - (((w)->request_buf + (w)->next_smb2_rcv_hdr_off)) +/** + * ksmbd_resp_buf_next - Get next buffer on compound response. + * @work: smb work containing response buffer + */ +static inline void *ksmbd_resp_buf_next(struct ksmbd_work *work) +{ + return work->response_buf + work->next_smb2_rsp_hdr_off; +} + +/** + * ksmbd_req_buf_next - Get next buffer on compound request. + * @work: smb work containing response buffer + */ +static inline void *ksmbd_req_buf_next(struct ksmbd_work *work) +{ + return work->request_buf + work->next_smb2_rcv_hdr_off; +} struct ksmbd_work *ksmbd_alloc_work_struct(void); void ksmbd_free_work_struct(struct ksmbd_work *work); |