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