Commit 0ec2ca38 authored by Neil Brown's avatar Neil Brown Committed by David S. Miller

[PATCH] kNFSd 1: New structure initialisers for lockd.

Just the new structure initialisers.
parent 44b2fd85
......@@ -206,61 +206,60 @@ xdr_decode_stat(struct rpc_rqst *rqstp, u32 *p, struct nsm_res *resp)
static struct rpc_procinfo nsm_procedures[] = {
{
p_procname: "sm_null",
p_encode: (kxdrproc_t) xdr_error,
p_decode: (kxdrproc_t) xdr_error,
.p_procname = "sm_null",
.p_encode = (kxdrproc_t) xdr_error,
.p_decode = (kxdrproc_t) xdr_error,
},
{
p_procname: "sm_stat",
p_encode: (kxdrproc_t) xdr_error,
p_decode: (kxdrproc_t) xdr_error,
.p_procname = "sm_stat",
.p_encode = (kxdrproc_t) xdr_error,
.p_decode = (kxdrproc_t) xdr_error,
},
{
p_procname: "sm_mon",
p_encode: (kxdrproc_t) xdr_encode_mon,
p_decode: (kxdrproc_t) xdr_decode_stat_res,
p_bufsiz: MAX(SM_mon_sz, SM_monres_sz) << 2,
.p_procname = "sm_mon",
.p_encode = (kxdrproc_t) xdr_encode_mon,
.p_decode = (kxdrproc_t) xdr_decode_stat_res,
.p_bufsiz = MAX(SM_mon_sz, SM_monres_sz) << 2,
},
{
p_procname: "sm_unmon",
p_encode: (kxdrproc_t) xdr_encode_mon,
p_decode: (kxdrproc_t) xdr_decode_stat,
p_bufsiz: MAX(SM_mon_id_sz, SM_unmonres_sz) << 2,
.p_procname = "sm_unmon",
.p_encode = (kxdrproc_t) xdr_encode_mon,
.p_decode = (kxdrproc_t) xdr_decode_stat,
.p_bufsiz = MAX(SM_mon_id_sz, SM_unmonres_sz) << 2,
},
{
p_procname: "sm_unmon_all",
p_encode: (kxdrproc_t) xdr_error,
p_decode: (kxdrproc_t) xdr_error,
.p_procname = "sm_unmon_all",
.p_encode = (kxdrproc_t) xdr_error,
.p_decode = (kxdrproc_t) xdr_error,
},
{
p_procname: "sm_simu_crash",
p_encode: (kxdrproc_t) xdr_error,
p_decode: (kxdrproc_t) xdr_error, 0, 0
.p_procname = "sm_simu_crash",
.p_encode = (kxdrproc_t) xdr_error,
.p_decode = (kxdrproc_t) xdr_error,
},
{
p_procname: "sm_notify",
p_encode: (kxdrproc_t) xdr_error,
p_decode: (kxdrproc_t) xdr_error,
.p_procname = "sm_notify",
.p_encode = (kxdrproc_t) xdr_error,
.p_decode = (kxdrproc_t) xdr_error,
},
};
static struct rpc_version nsm_version1 = {
number: 1,
nrprocs: sizeof(nsm_procedures)/sizeof(nsm_procedures[0]),
procs: nsm_procedures
.number = 1,
.nrprocs = sizeof(nsm_procedures)/sizeof(nsm_procedures[0]),
.procs = nsm_procedures
};
static struct rpc_version * nsm_version[] = {
NULL,
&nsm_version1,
[1] = &nsm_version1,
};
static struct rpc_stat nsm_stats;
struct rpc_program nsm_program = {
name: "statd",
number: SM_PROGRAM,
nrvers: sizeof(nsm_version)/sizeof(nsm_version[0]),
version: nsm_version,
stats: &nsm_stats
.name = "statd",
.number = SM_PROGRAM,
.nrvers = sizeof(nsm_version)/sizeof(nsm_version[0]),
.version = nsm_version,
.stats = &nsm_stats
};
......@@ -369,29 +369,27 @@ __setup("lockd.tcpport=", tcpport_set);
* Define NLM program and procedures
*/
static struct svc_version nlmsvc_version1 = {
vs_vers: 1,
vs_nproc: 17,
vs_proc: nlmsvc_procedures,
.vs_vers = 1,
.vs_nproc = 17,
.vs_proc = nlmsvc_procedures,
};
static struct svc_version nlmsvc_version3 = {
vs_vers: 3,
vs_nproc: 24,
vs_proc: nlmsvc_procedures,
.vs_vers = 3,
.vs_nproc = 24,
.vs_proc = nlmsvc_procedures,
};
#ifdef CONFIG_LOCKD_V4
static struct svc_version nlmsvc_version4 = {
vs_vers: 4,
vs_nproc: 24,
vs_proc: nlmsvc_procedures4,
.vs_vers = 4,
.vs_nproc = 24,
.vs_proc = nlmsvc_procedures4,
};
#endif
static struct svc_version * nlmsvc_version[] = {
NULL,
&nlmsvc_version1,
NULL,
&nlmsvc_version3,
[1] = &nlmsvc_version1,
[3] = &nlmsvc_version3,
#ifdef CONFIG_LOCKD_V4
&nlmsvc_version4,
[4] = &nlmsvc_version4,
#endif
};
......@@ -399,11 +397,11 @@ static struct svc_stat nlmsvc_stats;
#define NLM_NRVERS (sizeof(nlmsvc_version)/sizeof(nlmsvc_version[0]))
struct svc_program nlmsvc_program = {
pg_prog: NLM_PROGRAM, /* program number */
pg_lovers: 1, // version
pg_hivers: NLM_NRVERS-1, // range
pg_nvers: NLM_NRVERS, /* number of entries in nlmsvc_version */
pg_vers: nlmsvc_version, /* version table */
pg_name: "lockd", /* service name */
pg_stats: &nlmsvc_stats, /* stats table */
.pg_prog = NLM_PROGRAM, /* program number */
.pg_lovers = 1, /* version */
.pg_hivers = NLM_NRVERS-1, /* range */
.pg_nvers = NLM_NRVERS, /* number of entries in nlmsvc_version */
.pg_vers = nlmsvc_version, /* version table */
.pg_name = "lockd", /* service name */
.pg_stats = &nlmsvc_stats, /* stats table */
};
......@@ -527,15 +527,13 @@ nlm4svc_callback_exit(struct rpc_task *task)
struct nlm_void { int dummy; };
#define PROC(name, xargt, xrest, argt, rest, respsize) \
{ (svc_procfunc) nlm4svc_proc_##name, \
(kxdrproc_t) nlm4svc_decode_##xargt, \
(kxdrproc_t) nlm4svc_encode_##xrest, \
NULL, \
sizeof(struct nlm_##argt), \
sizeof(struct nlm_##rest), \
0, \
0, \
respsize, \
{ .pc_func = (svc_procfunc) nlm4svc_proc_##name, \
.pc_decode = (kxdrproc_t) nlm4svc_decode_##xargt, \
.pc_encode = (kxdrproc_t) nlm4svc_encode_##xrest, \
.pc_release = NULL, \
.pc_argsize = sizeof(struct nlm_##argt), \
.pc_ressize = sizeof(struct nlm_##rest), \
.pc_xdrressize = respsize, \
}
#define Ck (1+8) /* cookie */
#define No (1+1024/4) /* netobj */
......
......@@ -555,15 +555,13 @@ nlmsvc_callback_exit(struct rpc_task *task)
struct nlm_void { int dummy; };
#define PROC(name, xargt, xrest, argt, rest, respsize) \
{ (svc_procfunc) nlmsvc_proc_##name, \
(kxdrproc_t) nlmsvc_decode_##xargt, \
(kxdrproc_t) nlmsvc_encode_##xrest, \
NULL, \
sizeof(struct nlm_##argt), \
sizeof(struct nlm_##rest), \
0, \
0, \
respsize, \
{ .pc_func = (svc_procfunc) nlmsvc_proc_##name, \
.pc_decode = (kxdrproc_t) nlmsvc_decode_##xargt, \
.pc_encode = (kxdrproc_t) nlmsvc_encode_##xrest, \
.pc_release = NULL, \
.pc_argsize = sizeof(struct nlm_##argt), \
.pc_ressize = sizeof(struct nlm_##rest), \
.pc_xdrressize = respsize, \
}
#define Ck (1+8) /* cookie */
......
......@@ -602,15 +602,15 @@ static struct rpc_procinfo nlm_procedures[] = {
};
static struct rpc_version nlm_version1 = {
number: 1,
nrprocs: 16,
procs: nlm_procedures,
.number = 1,
.nrprocs = 16,
.procs = nlm_procedures,
};
static struct rpc_version nlm_version3 = {
number: 3,
nrprocs: 24,
procs: nlm_procedures,
.number = 3,
.nrprocs = 24,
.procs = nlm_procedures,
};
#ifdef CONFIG_LOCKD_V4
......@@ -618,23 +618,21 @@ extern struct rpc_version nlm_version4;
#endif
static struct rpc_version * nlm_versions[] = {
NULL,
&nlm_version1,
NULL,
&nlm_version3,
[1] = &nlm_version1,
[3] = &nlm_version3,
#ifdef CONFIG_LOCKD_V4
&nlm_version4,
[4] = &nlm_version4,
#endif
};
static struct rpc_stat nlm_stats;
struct rpc_program nlm_program = {
name: "lockd",
number: NLM_PROGRAM,
nrvers: sizeof(nlm_versions) / sizeof(nlm_versions[0]),
version: nlm_versions,
stats: &nlm_stats,
.name = "lockd",
.number = NLM_PROGRAM,
.nrvers = sizeof(nlm_versions) / sizeof(nlm_versions[0]),
.version = nlm_versions,
.stats = &nlm_stats,
};
#ifdef LOCKD_DEBUG
......
......@@ -608,7 +608,7 @@ static struct rpc_procinfo nlm4_procedures[] = {
};
struct rpc_version nlm_version4 = {
number: 4,
nrprocs: 24,
procs: nlm4_procedures,
.number = 4,
.nrprocs = 24,
.procs = nlm4_procedures,
};
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment