RDMA/rtrs: Remove 'dir' argument from rnbd_srv_rdma_ev
authorGuoqing Jiang <guoqing.jiang@linux.dev>
Fri, 26 Aug 2022 08:11:17 +0000 (16:11 +0800)
committerLeon Romanovsky <leonro@nvidia.com>
Tue, 30 Aug 2022 09:13:57 +0000 (12:13 +0300)
Since process_{read,write} already prints direction info if ctx->ops.rdma_ev
fails, no need to pass 'dir'.

Link: https://lore.kernel.org/r/20220826081117.21687-1-guoqing.jiang@linux.dev
Signed-off-by: Guoqing Jiang <guoqing.jiang@linux.dev>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
drivers/block/rnbd/rnbd-srv.c
drivers/infiniband/ulp/rtrs/rtrs-srv.c
drivers/infiniband/ulp/rtrs/rtrs.h

index 5e08da2..d07ff3b 100644 (file)
@@ -359,10 +359,9 @@ static int process_msg_sess_info(struct rnbd_srv_session *srv_sess,
                                 const void *msg, size_t len,
                                 void *data, size_t datalen);
 
-static int rnbd_srv_rdma_ev(void *priv,
-                           struct rtrs_srv_op *id, int dir,
-                           void *data, size_t datalen, const void *usr,
-                           size_t usrlen)
+static int rnbd_srv_rdma_ev(void *priv, struct rtrs_srv_op *id,
+                           void *data, size_t datalen,
+                           const void *usr, size_t usrlen)
 {
        struct rnbd_srv_session *srv_sess = priv;
        const struct rnbd_msg_hdr *hdr = usr;
@@ -388,8 +387,8 @@ static int rnbd_srv_rdma_ev(void *priv,
                                            datalen);
                break;
        default:
-               pr_warn("Received unexpected message type %d with dir %d from session %s\n",
-                       type, dir, srv_sess->sessname);
+               pr_warn("Received unexpected message type %d from session %s\n",
+                       type, srv_sess->sessname);
                return -EINVAL;
        }
 
index 22e6f99..f0cac27 100644 (file)
@@ -1022,7 +1022,7 @@ static void process_read(struct rtrs_srv_con *con,
        usr_len = le16_to_cpu(msg->usr_len);
        data_len = off - usr_len;
        data = page_address(srv->chunks[buf_id]);
-       ret = ctx->ops.rdma_ev(srv->priv, id, READ, data, data_len,
+       ret = ctx->ops.rdma_ev(srv->priv, id, data, data_len,
                           data + data_len, usr_len);
 
        if (ret) {
@@ -1075,7 +1075,7 @@ static void process_write(struct rtrs_srv_con *con,
        usr_len = le16_to_cpu(req->usr_len);
        data_len = off - usr_len;
        data = page_address(srv->chunks[buf_id]);
-       ret = ctx->ops.rdma_ev(srv->priv, id, WRITE, data, data_len,
+       ret = ctx->ops.rdma_ev(srv->priv, id, data, data_len,
                               data + data_len, usr_len);
        if (ret) {
                rtrs_err_rl(s,
index 5e57a7c..b48b53a 100644 (file)
@@ -139,7 +139,6 @@ struct rtrs_srv_ops {
 
         *      @priv:          Private data set by rtrs_srv_set_sess_priv()
         *      @id:            internal RTRS operation id
-        *      @dir:           READ/WRITE
         *      @data:          Pointer to (bidirectional) rdma memory area:
         *                      - in case of %RTRS_SRV_RDMA_EV_RECV contains
         *                      data sent by the client
@@ -151,7 +150,7 @@ struct rtrs_srv_ops {
         *      @usrlen:        Size of the user message
         */
        int (*rdma_ev)(void *priv,
-                      struct rtrs_srv_op *id, int dir,
+                      struct rtrs_srv_op *id,
                       void *data, size_t datalen, const void *usr,
                       size_t usrlen);
        /**