Commit c81cba85 authored by Gioh Kim's avatar Gioh Kim Committed by Jens Axboe

block/rnbd-srv: Remove unused arguments of rnbd_srv_rdma_ev

struct rtrs_srv is not used when handling rnbd_srv_rdma_ev messages, so
cleaned up
rdma_ev function pointer in rtrs_srv_ops also is changed.

Cc: Leon Romanovsky <leonro@nvidia.com>
Cc: linux-rdma@vger.kernel.org
Signed-off-by: default avatarAleksei Marov <aleksei.marov@ionos.com>
Signed-off-by: default avatarJack Wang <jinpu.wang@ionos.com>
Signed-off-by: default avatarGioh Kim <gi-oh.kim@ionos.com>
Reviewed-by: default avatarChaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Acked-by: default avatarJason Gunthorpe <jgg@nvidia.com>
Reviewed-by: default avatarLeon Romanovsky <leonro@nvidia.com>
Link: https://lore.kernel.org/r/20210419073722.15351-16-gi-oh.kim@ionos.comSigned-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 015fcf13
...@@ -114,8 +114,7 @@ rnbd_get_sess_dev(int dev_id, struct rnbd_srv_session *srv_sess) ...@@ -114,8 +114,7 @@ rnbd_get_sess_dev(int dev_id, struct rnbd_srv_session *srv_sess)
return sess_dev; return sess_dev;
} }
static int process_rdma(struct rtrs_srv *sess, static int process_rdma(struct rnbd_srv_session *srv_sess,
struct rnbd_srv_session *srv_sess,
struct rtrs_srv_op *id, void *data, u32 datalen, struct rtrs_srv_op *id, void *data, u32 datalen,
const void *usr, size_t usrlen) const void *usr, size_t usrlen)
{ {
...@@ -344,8 +343,7 @@ void rnbd_srv_sess_dev_force_close(struct rnbd_srv_sess_dev *sess_dev, ...@@ -344,8 +343,7 @@ void rnbd_srv_sess_dev_force_close(struct rnbd_srv_sess_dev *sess_dev,
mutex_unlock(&sess->lock); mutex_unlock(&sess->lock);
} }
static int process_msg_close(struct rtrs_srv *rtrs, static int process_msg_close(struct rnbd_srv_session *srv_sess,
struct rnbd_srv_session *srv_sess,
void *data, size_t datalen, const void *usr, void *data, size_t datalen, const void *usr,
size_t usrlen) size_t usrlen)
{ {
...@@ -364,17 +362,15 @@ static int process_msg_close(struct rtrs_srv *rtrs, ...@@ -364,17 +362,15 @@ static int process_msg_close(struct rtrs_srv *rtrs,
return 0; return 0;
} }
static int process_msg_open(struct rtrs_srv *rtrs, static int process_msg_open(struct rnbd_srv_session *srv_sess,
struct rnbd_srv_session *srv_sess,
const void *msg, size_t len, const void *msg, size_t len,
void *data, size_t datalen); void *data, size_t datalen);
static int process_msg_sess_info(struct rtrs_srv *rtrs, static int process_msg_sess_info(struct rnbd_srv_session *srv_sess,
struct rnbd_srv_session *srv_sess,
const void *msg, size_t len, const void *msg, size_t len,
void *data, size_t datalen); void *data, size_t datalen);
static int rnbd_srv_rdma_ev(struct rtrs_srv *rtrs, void *priv, static int rnbd_srv_rdma_ev(void *priv,
struct rtrs_srv_op *id, int dir, struct rtrs_srv_op *id, int dir,
void *data, size_t datalen, const void *usr, void *data, size_t datalen, const void *usr,
size_t usrlen) size_t usrlen)
...@@ -391,19 +387,16 @@ static int rnbd_srv_rdma_ev(struct rtrs_srv *rtrs, void *priv, ...@@ -391,19 +387,16 @@ static int rnbd_srv_rdma_ev(struct rtrs_srv *rtrs, void *priv,
switch (type) { switch (type) {
case RNBD_MSG_IO: case RNBD_MSG_IO:
return process_rdma(rtrs, srv_sess, id, data, datalen, usr, return process_rdma(srv_sess, id, data, datalen, usr, usrlen);
usrlen);
case RNBD_MSG_CLOSE: case RNBD_MSG_CLOSE:
ret = process_msg_close(rtrs, srv_sess, data, datalen, ret = process_msg_close(srv_sess, data, datalen, usr, usrlen);
usr, usrlen);
break; break;
case RNBD_MSG_OPEN: case RNBD_MSG_OPEN:
ret = process_msg_open(rtrs, srv_sess, usr, usrlen, ret = process_msg_open(srv_sess, usr, usrlen, data, datalen);
data, datalen);
break; break;
case RNBD_MSG_SESS_INFO: case RNBD_MSG_SESS_INFO:
ret = process_msg_sess_info(rtrs, srv_sess, usr, usrlen, ret = process_msg_sess_info(srv_sess, usr, usrlen, data,
data, datalen); datalen);
break; break;
default: default:
pr_warn("Received unexpected message type %d with dir %d from session %s\n", pr_warn("Received unexpected message type %d with dir %d from session %s\n",
...@@ -656,8 +649,7 @@ static char *rnbd_srv_get_full_path(struct rnbd_srv_session *srv_sess, ...@@ -656,8 +649,7 @@ static char *rnbd_srv_get_full_path(struct rnbd_srv_session *srv_sess,
return full_path; return full_path;
} }
static int process_msg_sess_info(struct rtrs_srv *rtrs, static int process_msg_sess_info(struct rnbd_srv_session *srv_sess,
struct rnbd_srv_session *srv_sess,
const void *msg, size_t len, const void *msg, size_t len,
void *data, size_t datalen) void *data, size_t datalen)
{ {
...@@ -698,8 +690,7 @@ find_srv_sess_dev(struct rnbd_srv_session *srv_sess, const char *dev_name) ...@@ -698,8 +690,7 @@ find_srv_sess_dev(struct rnbd_srv_session *srv_sess, const char *dev_name)
return NULL; return NULL;
} }
static int process_msg_open(struct rtrs_srv *rtrs, static int process_msg_open(struct rnbd_srv_session *srv_sess,
struct rnbd_srv_session *srv_sess,
const void *msg, size_t len, const void *msg, size_t len,
void *data, size_t datalen) void *data, size_t datalen)
{ {
......
...@@ -998,7 +998,7 @@ static void process_read(struct rtrs_srv_con *con, ...@@ -998,7 +998,7 @@ static void process_read(struct rtrs_srv_con *con,
usr_len = le16_to_cpu(msg->usr_len); usr_len = le16_to_cpu(msg->usr_len);
data_len = off - usr_len; data_len = off - usr_len;
data = page_address(srv->chunks[buf_id]); data = page_address(srv->chunks[buf_id]);
ret = ctx->ops.rdma_ev(srv, srv->priv, id, READ, data, data_len, ret = ctx->ops.rdma_ev(srv->priv, id, READ, data, data_len,
data + data_len, usr_len); data + data_len, usr_len);
if (unlikely(ret)) { if (unlikely(ret)) {
...@@ -1051,7 +1051,7 @@ static void process_write(struct rtrs_srv_con *con, ...@@ -1051,7 +1051,7 @@ static void process_write(struct rtrs_srv_con *con,
usr_len = le16_to_cpu(req->usr_len); usr_len = le16_to_cpu(req->usr_len);
data_len = off - usr_len; data_len = off - usr_len;
data = page_address(srv->chunks[buf_id]); data = page_address(srv->chunks[buf_id]);
ret = ctx->ops.rdma_ev(srv, srv->priv, id, WRITE, data, data_len, ret = ctx->ops.rdma_ev(srv->priv, id, WRITE, data, data_len,
data + data_len, usr_len); data + data_len, usr_len);
if (unlikely(ret)) { if (unlikely(ret)) {
rtrs_err_rl(s, rtrs_err_rl(s,
......
...@@ -139,7 +139,6 @@ struct rtrs_srv_ops { ...@@ -139,7 +139,6 @@ struct rtrs_srv_ops {
* message for the data transfer will be sent to * message for the data transfer will be sent to
* the client. * the client.
* @sess: Session
* @priv: Private data set by rtrs_srv_set_sess_priv() * @priv: Private data set by rtrs_srv_set_sess_priv()
* @id: internal RTRS operation id * @id: internal RTRS operation id
* @dir: READ/WRITE * @dir: READ/WRITE
...@@ -153,7 +152,7 @@ struct rtrs_srv_ops { ...@@ -153,7 +152,7 @@ struct rtrs_srv_ops {
* @usr: The extra user message sent by the client (%vec) * @usr: The extra user message sent by the client (%vec)
* @usrlen: Size of the user message * @usrlen: Size of the user message
*/ */
int (*rdma_ev)(struct rtrs_srv *sess, void *priv, int (*rdma_ev)(void *priv,
struct rtrs_srv_op *id, int dir, struct rtrs_srv_op *id, int dir,
void *data, size_t datalen, const void *usr, void *data, size_t datalen, const void *usr,
size_t usrlen); size_t usrlen);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment