Skip to content

Commit 2059b69

Browse files
committed
SUNRPC: Simplify synopsis of svc_pool_for_cpu()
Clean up: There is one caller. The @cpu argument can be made implicit now that a get_cpu/put_cpu pair is no longer needed. Signed-off-by: Chuck Lever <[email protected]>
1 parent 586095d commit 2059b69

File tree

3 files changed

+14
-8
lines changed

3 files changed

+14
-8
lines changed

include/linux/sunrpc/svc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,7 @@ int svc_register(const struct svc_serv *, struct net *, const int,
504504

505505
void svc_wake_up(struct svc_serv *);
506506
void svc_reserve(struct svc_rqst *rqstp, int space);
507-
struct svc_pool * svc_pool_for_cpu(struct svc_serv *serv, int cpu);
507+
struct svc_pool *svc_pool_for_cpu(struct svc_serv *serv);
508508
char * svc_print_addr(struct svc_rqst *, char *, size_t);
509509
const char * svc_proc_name(const struct svc_rqst *rqstp);
510510
int svc_encode_result_payload(struct svc_rqst *rqstp,

net/sunrpc/svc.c

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -356,15 +356,21 @@ svc_pool_map_set_cpumask(struct task_struct *task, unsigned int pidx)
356356
}
357357
}
358358

359-
/*
360-
* Use the mapping mode to choose a pool for a given CPU.
361-
* Used when enqueueing an incoming RPC. Always returns
362-
* a non-NULL pool pointer.
359+
/**
360+
* svc_pool_for_cpu - Select pool to run a thread on this cpu
361+
* @serv: An RPC service
362+
*
363+
* Use the active CPU and the svc_pool_map's mode setting to
364+
* select the svc thread pool to use. Once initialized, the
365+
* svc_pool_map does not change.
366+
*
367+
* Return value:
368+
* A pointer to an svc_pool
363369
*/
364-
struct svc_pool *
365-
svc_pool_for_cpu(struct svc_serv *serv, int cpu)
370+
struct svc_pool *svc_pool_for_cpu(struct svc_serv *serv)
366371
{
367372
struct svc_pool_map *m = &svc_pool_map;
373+
int cpu = raw_smp_processor_id();
368374
unsigned int pidx = 0;
369375

370376
if (serv->sv_nrpools <= 1)

net/sunrpc/svc_xprt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,7 @@ void svc_xprt_enqueue(struct svc_xprt *xprt)
460460
if (test_and_set_bit(XPT_BUSY, &xprt->xpt_flags))
461461
return;
462462

463-
pool = svc_pool_for_cpu(xprt->xpt_server, raw_smp_processor_id());
463+
pool = svc_pool_for_cpu(xprt->xpt_server);
464464

465465
atomic_long_inc(&pool->sp_stats.packets);
466466

0 commit comments

Comments
 (0)