Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

sunrpc: add a struct rpc_stats arg to rpc_create_args

We want to be able to have our rpc stats handled in a per network
namespace manner, so add an option to rpc_create_args to specify a
different rpc_stats struct instead of using the one on the rpc_program.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>

authored by

Josef Bacik and committed by
Trond Myklebust
2057a48d edc99a2d

+5 -1
+1
include/linux/sunrpc/clnt.h
··· 139 139 const char *servername; 140 140 const char *nodename; 141 141 const struct rpc_program *program; 142 + struct rpc_stat *stats; 142 143 u32 prognumber; /* overrides program->number */ 143 144 u32 version; 144 145 rpc_authflavor_t authflavor;
+4 -1
net/sunrpc/clnt.c
··· 405 405 clnt->cl_maxproc = version->nrprocs; 406 406 clnt->cl_prog = args->prognumber ? : program->number; 407 407 clnt->cl_vers = version->number; 408 - clnt->cl_stats = program->stats; 408 + clnt->cl_stats = args->stats ? : program->stats; 409 409 clnt->cl_metrics = rpc_alloc_iostats(clnt); 410 410 rpc_init_pipe_dir_head(&clnt->cl_pipedir_objects); 411 411 err = -ENOMEM; ··· 691 691 .version = clnt->cl_vers, 692 692 .authflavor = clnt->cl_auth->au_flavor, 693 693 .cred = clnt->cl_cred, 694 + .stats = clnt->cl_stats, 694 695 }; 695 696 return __rpc_clone_client(&args, clnt); 696 697 } ··· 714 713 .version = clnt->cl_vers, 715 714 .authflavor = flavor, 716 715 .cred = clnt->cl_cred, 716 + .stats = clnt->cl_stats, 717 717 }; 718 718 return __rpc_clone_client(&args, clnt); 719 719 } ··· 1070 1068 .version = vers, 1071 1069 .authflavor = old->cl_auth->au_flavor, 1072 1070 .cred = old->cl_cred, 1071 + .stats = old->cl_stats, 1073 1072 }; 1074 1073 struct rpc_clnt *clnt; 1075 1074 int err;