aboutsummaryrefslogtreecommitdiffstats
path: root/fs/lockd/mon.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/lockd/mon.c')
-rw-r--r--fs/lockd/mon.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/fs/lockd/mon.c b/fs/lockd/mon.c
index 0edc03e67966..3fc683f46b3e 100644
--- a/fs/lockd/mon.c
+++ b/fs/lockd/mon.c
@@ -35,6 +35,10 @@ nsm_mon_unmon(struct nlm_host *host, u32 proc, struct nsm_res *res)
35 struct rpc_clnt *clnt; 35 struct rpc_clnt *clnt;
36 int status; 36 int status;
37 struct nsm_args args; 37 struct nsm_args args;
38 struct rpc_message msg = {
39 .rpc_argp = &args,
40 .rpc_resp = res,
41 };
38 42
39 clnt = nsm_create(); 43 clnt = nsm_create();
40 if (IS_ERR(clnt)) { 44 if (IS_ERR(clnt)) {
@@ -49,7 +53,8 @@ nsm_mon_unmon(struct nlm_host *host, u32 proc, struct nsm_res *res)
49 args.proc = NLMPROC_NSM_NOTIFY; 53 args.proc = NLMPROC_NSM_NOTIFY;
50 memset(res, 0, sizeof(*res)); 54 memset(res, 0, sizeof(*res));
51 55
52 status = rpc_call(clnt, proc, &args, res, 0); 56 msg.rpc_proc = &clnt->cl_procinfo[proc];
57 status = rpc_call_sync(clnt, &msg, 0);
53 if (status < 0) 58 if (status < 0)
54 printk(KERN_DEBUG "nsm_mon_unmon: rpc failed, status=%d\n", 59 printk(KERN_DEBUG "nsm_mon_unmon: rpc failed, status=%d\n",
55 status); 60 status);
@@ -214,18 +219,22 @@ static struct rpc_procinfo nsm_procedures[] = {
214 .p_encode = (kxdrproc_t) xdr_encode_mon, 219 .p_encode = (kxdrproc_t) xdr_encode_mon,
215 .p_decode = (kxdrproc_t) xdr_decode_stat_res, 220 .p_decode = (kxdrproc_t) xdr_decode_stat_res,
216 .p_bufsiz = MAX(SM_mon_sz, SM_monres_sz) << 2, 221 .p_bufsiz = MAX(SM_mon_sz, SM_monres_sz) << 2,
222 .p_statidx = SM_MON,
223 .p_name = "MONITOR",
217 }, 224 },
218[SM_UNMON] = { 225[SM_UNMON] = {
219 .p_proc = SM_UNMON, 226 .p_proc = SM_UNMON,
220 .p_encode = (kxdrproc_t) xdr_encode_unmon, 227 .p_encode = (kxdrproc_t) xdr_encode_unmon,
221 .p_decode = (kxdrproc_t) xdr_decode_stat, 228 .p_decode = (kxdrproc_t) xdr_decode_stat,
222 .p_bufsiz = MAX(SM_mon_id_sz, SM_unmonres_sz) << 2, 229 .p_bufsiz = MAX(SM_mon_id_sz, SM_unmonres_sz) << 2,
230 .p_statidx = SM_UNMON,
231 .p_name = "UNMONITOR",
223 }, 232 },
224}; 233};
225 234
226static struct rpc_version nsm_version1 = { 235static struct rpc_version nsm_version1 = {
227 .number = 1, 236 .number = 1,
228 .nrprocs = sizeof(nsm_procedures)/sizeof(nsm_procedures[0]), 237 .nrprocs = ARRAY_SIZE(nsm_procedures),
229 .procs = nsm_procedures 238 .procs = nsm_procedures
230}; 239};
231 240
@@ -238,7 +247,7 @@ static struct rpc_stat nsm_stats;
238static struct rpc_program nsm_program = { 247static struct rpc_program nsm_program = {
239 .name = "statd", 248 .name = "statd",
240 .number = SM_PROGRAM, 249 .number = SM_PROGRAM,
241 .nrvers = sizeof(nsm_version)/sizeof(nsm_version[0]), 250 .nrvers = ARRAY_SIZE(nsm_version),
242 .version = nsm_version, 251 .version = nsm_version,
243 .stats = &nsm_stats 252 .stats = &nsm_stats
244}; 253};