* [PATCH] Staging: lustre: rpc: Remove unnecessary wrapper function
@ 2015-10-29 6:22 Shivani Bhardwaj
2015-10-29 10:56 ` [Outreachy kernel] " Sudip Mukherjee
0 siblings, 1 reply; 3+ messages in thread
From: Shivani Bhardwaj @ 2015-10-29 6:22 UTC (permalink / raw)
To: outreachy-kernel
Remove the function srpc_post_active_rqtbuf() and replace its only call
with the function srpc_post_active_rdma() by adding and typecasting the
appropriate parameters.
Signed-off-by: Shivani Bhardwaj <shivanib134@gmail.com>
---
drivers/staging/lustre/lnet/selftest/rpc.c | 17 +++++------------
1 file changed, 5 insertions(+), 12 deletions(-)
diff --git a/drivers/staging/lustre/lnet/selftest/rpc.c b/drivers/staging/lustre/lnet/selftest/rpc.c
index 162f9d3..cb895c3 100644
--- a/drivers/staging/lustre/lnet/selftest/rpc.c
+++ b/drivers/staging/lustre/lnet/selftest/rpc.c
@@ -445,15 +445,6 @@ srpc_post_active_rdma(int portal, __u64 matchbits, void *buf, int len,
}
static int
-srpc_post_active_rqtbuf(lnet_process_id_t peer, int service, void *buf,
- int len, lnet_handle_md_t *mdh, srpc_event_t *ev)
-{
- return srpc_post_active_rdma(srpc_serv_portal(service), service,
- buf, len, LNET_MD_OP_PUT, peer,
- LNET_NID_ANY, mdh, ev);
-}
-
-static int
srpc_post_passive_rqtbuf(int service, int local, void *buf, int len,
lnet_handle_md_t *mdh, srpc_event_t *ev)
{
@@ -798,9 +789,11 @@ srpc_send_request(srpc_client_rpc_t *rpc)
ev->ev_data = rpc;
ev->ev_type = SRPC_REQUEST_SENT;
- rc = srpc_post_active_rqtbuf(rpc->crpc_dest, rpc->crpc_service,
- &rpc->crpc_reqstmsg, sizeof(srpc_msg_t),
- &rpc->crpc_reqstmdh, ev);
+ rc = srpc_post_active_rdma(srpc_serv_portal(rpc->crpc_service),
+ rpc->crpc_service, &rpc->crpc_reqstmsg,
+ sizeof(srpc_msg_t), LNET_MD_OP_PUT,
+ (lnet_process_id_t)rpc->crpc_dest,
+ LNET_NID_ANY, &rpc->crpc_reqstmdh, ev);
if (rc != 0) {
LASSERT(rc == -ENOMEM);
ev->ev_fired = 1; /* no more event expected */
--
2.1.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Outreachy kernel] [PATCH] Staging: lustre: rpc: Remove unnecessary wrapper function
2015-10-29 6:22 [PATCH] Staging: lustre: rpc: Remove unnecessary wrapper function Shivani Bhardwaj
@ 2015-10-29 10:56 ` Sudip Mukherjee
2015-10-29 13:29 ` Shivani Bhardwaj
0 siblings, 1 reply; 3+ messages in thread
From: Sudip Mukherjee @ 2015-10-29 10:56 UTC (permalink / raw)
To: Shivani Bhardwaj; +Cc: outreachy-kernel
On Thu, Oct 29, 2015 at 11:52:23AM +0530, Shivani Bhardwaj wrote:
> Remove the function srpc_post_active_rqtbuf() and replace its only call
> with the function srpc_post_active_rdma() by adding and typecasting the
> appropriate parameters.
>
> Signed-off-by: Shivani Bhardwaj <shivanib134@gmail.com>
> ---
> drivers/staging/lustre/lnet/selftest/rpc.c | 17 +++++------------
> 1 file changed, 5 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/staging/lustre/lnet/selftest/rpc.c b/drivers/staging/lustre/lnet/selftest/rpc.c
> index 162f9d3..cb895c3 100644
> --- a/drivers/staging/lustre/lnet/selftest/rpc.c
> +++ b/drivers/staging/lustre/lnet/selftest/rpc.c
> @@ -445,15 +445,6 @@ srpc_post_active_rdma(int portal, __u64 matchbits, void *buf, int len,
> }
>
> static int
> -srpc_post_active_rqtbuf(lnet_process_id_t peer, int service, void *buf,
> - int len, lnet_handle_md_t *mdh, srpc_event_t *ev)
> -{
> - return srpc_post_active_rdma(srpc_serv_portal(service), service,
> - buf, len, LNET_MD_OP_PUT, peer,
> - LNET_NID_ANY, mdh, ev);
> -}
> -
> -static int
> srpc_post_passive_rqtbuf(int service, int local, void *buf, int len,
> lnet_handle_md_t *mdh, srpc_event_t *ev)
> {
> @@ -798,9 +789,11 @@ srpc_send_request(srpc_client_rpc_t *rpc)
> ev->ev_data = rpc;
> ev->ev_type = SRPC_REQUEST_SENT;
>
> - rc = srpc_post_active_rqtbuf(rpc->crpc_dest, rpc->crpc_service,
> - &rpc->crpc_reqstmsg, sizeof(srpc_msg_t),
> - &rpc->crpc_reqstmdh, ev);
> + rc = srpc_post_active_rdma(srpc_serv_portal(rpc->crpc_service),
> + rpc->crpc_service, &rpc->crpc_reqstmsg,
> + sizeof(srpc_msg_t), LNET_MD_OP_PUT,
> + (lnet_process_id_t)rpc->crpc_dest,
why do you need the typecast to lnet_process_id_t?
crpc_dest is already of the type lnet_process_id_t.
check lustre/lnet/selftest/selftest.h file.
regards
sudip
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Outreachy kernel] [PATCH] Staging: lustre: rpc: Remove unnecessary wrapper function
2015-10-29 10:56 ` [Outreachy kernel] " Sudip Mukherjee
@ 2015-10-29 13:29 ` Shivani Bhardwaj
0 siblings, 0 replies; 3+ messages in thread
From: Shivani Bhardwaj @ 2015-10-29 13:29 UTC (permalink / raw)
To: Sudip Mukherjee; +Cc: outreachy-kernel
[-- Attachment #1: Type: text/plain, Size: 2365 bytes --]
On Thu, Oct 29, 2015 at 4:26 PM, Sudip Mukherjee <sudipm.mukherjee@gmail.com
> wrote:
> On Thu, Oct 29, 2015 at 11:52:23AM +0530, Shivani Bhardwaj wrote:
> > Remove the function srpc_post_active_rqtbuf() and replace its only call
> > with the function srpc_post_active_rdma() by adding and typecasting the
> > appropriate parameters.
> >
> > Signed-off-by: Shivani Bhardwaj <shivanib134@gmail.com>
> > ---
> > drivers/staging/lustre/lnet/selftest/rpc.c | 17 +++++------------
> > 1 file changed, 5 insertions(+), 12 deletions(-)
> >
> > diff --git a/drivers/staging/lustre/lnet/selftest/rpc.c
> b/drivers/staging/lustre/lnet/selftest/rpc.c
> > index 162f9d3..cb895c3 100644
> > --- a/drivers/staging/lustre/lnet/selftest/rpc.c
> > +++ b/drivers/staging/lustre/lnet/selftest/rpc.c
> > @@ -445,15 +445,6 @@ srpc_post_active_rdma(int portal, __u64 matchbits,
> void *buf, int len,
> > }
> >
> > static int
> > -srpc_post_active_rqtbuf(lnet_process_id_t peer, int service, void *buf,
> > - int len, lnet_handle_md_t *mdh, srpc_event_t *ev)
> > -{
> > - return srpc_post_active_rdma(srpc_serv_portal(service), service,
> > - buf, len, LNET_MD_OP_PUT, peer,
> > - LNET_NID_ANY, mdh, ev);
> > -}
> > -
> > -static int
> > srpc_post_passive_rqtbuf(int service, int local, void *buf, int len,
> > lnet_handle_md_t *mdh, srpc_event_t *ev)
> > {
> > @@ -798,9 +789,11 @@ srpc_send_request(srpc_client_rpc_t *rpc)
> > ev->ev_data = rpc;
> > ev->ev_type = SRPC_REQUEST_SENT;
> >
> > - rc = srpc_post_active_rqtbuf(rpc->crpc_dest, rpc->crpc_service,
> > - &rpc->crpc_reqstmsg,
> sizeof(srpc_msg_t),
> > - &rpc->crpc_reqstmdh, ev);
> > + rc = srpc_post_active_rdma(srpc_serv_portal(rpc->crpc_service),
> > + rpc->crpc_service, &rpc->crpc_reqstmsg,
> > + sizeof(srpc_msg_t), LNET_MD_OP_PUT,
> > + (lnet_process_id_t)rpc->crpc_dest,
>
> why do you need the typecast to lnet_process_id_t?
>
> crpc_dest is already of the type lnet_process_id_t.
> check lustre/lnet/selftest/selftest.h file.
>
> regards
> sudip
>
Thanks for pointing out. I've sent v2. Please check that.
Thank you
[-- Attachment #2: Type: text/html, Size: 3364 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-10-29 13:29 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-29 6:22 [PATCH] Staging: lustre: rpc: Remove unnecessary wrapper function Shivani Bhardwaj
2015-10-29 10:56 ` [Outreachy kernel] " Sudip Mukherjee
2015-10-29 13:29 ` Shivani Bhardwaj
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.