aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/sunrpc
diff options
context:
space:
mode:
authorChuck Lever <chuck.lever@oracle.com>2016-09-15 10:55:29 -0400
committerAnna Schumaker <Anna.Schumaker@Netapp.com>2016-09-19 13:08:37 -0400
commit3435c74aed2d7b743ccbf34616c523ebee7be943 (patch)
tree7f0c96c886f2d0e4992508fb79a7b2ab3c05dc6b /include/linux/sunrpc
parent5fe6eaa1f9a00b9a5927e3b791ecad2f3eaab130 (diff)
SUNRPC: Generalize the RPC buffer release API
xprtrdma needs to allocate the Call and Reply buffers separately. TBH, the reliance on using a single buffer for the pair of XDR buffers is transport implementation-specific. Instead of passing just the rq_buffer into the buf_free method, pass the task structure and let buf_free take care of freeing both XDR buffers at once. There's a micro-optimization here. In the common case, both xprt_release and the transport's buf_free method were checking if rq_buffer was NULL. Now the check is done only once per RPC. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Diffstat (limited to 'include/linux/sunrpc')
-rw-r--r--include/linux/sunrpc/sched.h2
-rw-r--r--include/linux/sunrpc/xprt.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/include/linux/sunrpc/sched.h b/include/linux/sunrpc/sched.h
index 38d4c1b378f2..7ba040c797ec 100644
--- a/include/linux/sunrpc/sched.h
+++ b/include/linux/sunrpc/sched.h
@@ -240,7 +240,7 @@ struct rpc_task *rpc_wake_up_first(struct rpc_wait_queue *,
240void rpc_wake_up_status(struct rpc_wait_queue *, int); 240void rpc_wake_up_status(struct rpc_wait_queue *, int);
241void rpc_delay(struct rpc_task *, unsigned long); 241void rpc_delay(struct rpc_task *, unsigned long);
242int rpc_malloc(struct rpc_task *); 242int rpc_malloc(struct rpc_task *);
243void rpc_free(void *); 243void rpc_free(struct rpc_task *);
244int rpciod_up(void); 244int rpciod_up(void);
245void rpciod_down(void); 245void rpciod_down(void);
246int __rpc_wait_for_completion_task(struct rpc_task *task, wait_bit_action_f *); 246int __rpc_wait_for_completion_task(struct rpc_task *task, wait_bit_action_f *);
diff --git a/include/linux/sunrpc/xprt.h b/include/linux/sunrpc/xprt.h
index c01f468fb374..72c2aebc592b 100644
--- a/include/linux/sunrpc/xprt.h
+++ b/include/linux/sunrpc/xprt.h
@@ -128,7 +128,7 @@ struct rpc_xprt_ops {
128 void (*set_port)(struct rpc_xprt *xprt, unsigned short port); 128 void (*set_port)(struct rpc_xprt *xprt, unsigned short port);
129 void (*connect)(struct rpc_xprt *xprt, struct rpc_task *task); 129 void (*connect)(struct rpc_xprt *xprt, struct rpc_task *task);
130 int (*buf_alloc)(struct rpc_task *task); 130 int (*buf_alloc)(struct rpc_task *task);
131 void (*buf_free)(void *buffer); 131 void (*buf_free)(struct rpc_task *task);
132 int (*send_request)(struct rpc_task *task); 132 int (*send_request)(struct rpc_task *task);
133 void (*set_retrans_timeout)(struct rpc_task *task); 133 void (*set_retrans_timeout)(struct rpc_task *task);
134 void (*timer)(struct rpc_xprt *xprt, struct rpc_task *task); 134 void (*timer)(struct rpc_xprt *xprt, struct rpc_task *task);