The patch titled knfsd: lockd: make the nsm upcalls use the nsm_handle has been added to the -mm tree. Its filename is knfsd-lockd-make-the-nsm-upcalls-use-the-nsm_handle.patch See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find out what to do about this ------------------------------------------------------ Subject: knfsd: lockd: make the nsm upcalls use the nsm_handle From: Olaf Kirch <okir@xxxxxxx> This converts the statd upcalls to use the nsm_handle This means that we only register each host once with statd, rather than registering each host/vers/protocol triple. Signed-off-by: Olaf Kirch <okir@xxxxxxx> Signed-off-by: Neil Brown <neilb@xxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxx> --- fs/lockd/mon.c | 30 ++++++++++++++++++------------ include/linux/lockd/sm_inter.h | 1 - 2 files changed, 18 insertions(+), 13 deletions(-) diff -puN fs/lockd/mon.c~knfsd-lockd-make-the-nsm-upcalls-use-the-nsm_handle fs/lockd/mon.c --- a/fs/lockd/mon.c~knfsd-lockd-make-the-nsm-upcalls-use-the-nsm_handle +++ a/fs/lockd/mon.c @@ -30,7 +30,7 @@ u32 nsm_local_state; * Common procedure for SM_MON/SM_UNMON calls */ static int -nsm_mon_unmon(struct nlm_host *host, u32 proc, struct nsm_res *res) +nsm_mon_unmon(struct nsm_handle *nsm, u32 proc, struct nsm_res *res) { struct rpc_clnt *clnt; int status; @@ -46,10 +46,10 @@ nsm_mon_unmon(struct nlm_host *host, u32 goto out; } - args.addr = host->h_addr.sin_addr.s_addr; - args.proto= (host->h_proto<<1) | host->h_server; + memset(&args, 0, sizeof(args)); + args.addr = nsm->sm_addr.sin_addr.s_addr; args.prog = NLM_PROGRAM; - args.vers = host->h_version; + args.vers = 3; args.proc = NLMPROC_NSM_NOTIFY; memset(res, 0, sizeof(*res)); @@ -80,7 +80,7 @@ nsm_monitor(struct nlm_host *host) if (nsm->sm_monitored) return 0; - status = nsm_mon_unmon(host, SM_MON, &res); + status = nsm_mon_unmon(nsm, SM_MON, &res); if (status < 0 || res.status != 0) printk(KERN_NOTICE "lockd: cannot monitor %s\n", host->h_name); @@ -99,16 +99,20 @@ nsm_unmonitor(struct nlm_host *host) struct nsm_res res; int status = 0; - dprintk("lockd: nsm_unmonitor(%s)\n", host->h_name); if (nsm == NULL) return 0; host->h_nsmhandle = NULL; - if (!host->h_killed) { - status = nsm_mon_unmon(host, SM_UNMON, &res); + if (atomic_read(&nsm->sm_count) == 1 + && nsm->sm_monitored && !nsm->sm_sticky) { + dprintk("lockd: nsm_unmonitor(%s)\n", host->h_name); + + status = nsm_mon_unmon(nsm, SM_UNMON, &res); if (status < 0) - printk(KERN_NOTICE "lockd: cannot unmonitor %s\n", host->h_name); - nsm->sm_monitored = 0; + printk(KERN_NOTICE "lockd: cannot unmonitor %s\n", + host->h_name); + else + nsm->sm_monitored = 0; } nsm_release(nsm); return status; @@ -171,9 +175,11 @@ xdr_encode_mon(struct rpc_rqst *rqstp, u p = xdr_encode_common(rqstp, p, argp); if (IS_ERR(p)) return PTR_ERR(p); + + /* Surprise - there may even be room for an IPv6 address now */ *p++ = argp->addr; - *p++ = argp->vers; - *p++ = argp->proto; + *p++ = 0; + *p++ = 0; *p++ = 0; rqstp->rq_slen = xdr_adjust_iovec(rqstp->rq_svec, p); return 0; diff -puN include/linux/lockd/sm_inter.h~knfsd-lockd-make-the-nsm-upcalls-use-the-nsm_handle include/linux/lockd/sm_inter.h --- a/include/linux/lockd/sm_inter.h~knfsd-lockd-make-the-nsm-upcalls-use-the-nsm_handle +++ a/include/linux/lockd/sm_inter.h @@ -28,7 +28,6 @@ struct nsm_args { u32 prog; /* RPC callback info */ u32 vers; u32 proc; - u32 proto; /* protocol (udp/tcp) plus server/client flag */ }; /* _ Patches currently in -mm which might be from okir@xxxxxxx are origin.patch ipmi-fix-occasional-oops-on-module-unload.patch knfsd-hide-use-of-lockds-h_monitored-flag.patch knfsd-consolidate-common-code-for-statd-lockd-notification.patch knfsd-when-looking-up-a-lockd-host-pass-hostname-length.patch knfsd-lockd-introduce-nsm_handle.patch knfsd-misc-minor-fixes-indentation-changes.patch knfsd-lockd-make-nlm_host_rebooted-use-the-nsm_handle.patch knfsd-lockd-make-the-nsm-upcalls-use-the-nsm_handle.patch knfsd-lockd-make-the-hash-chains-use-a-hlist_node.patch knfsd-lockd-change-list-of-blocked-list-to-list_node.patch knfsd-change-nlm_file-to-use-a-hlist.patch knfsd-lockd-make-nlm_traverse_-more-flexible.patch knfsd-lockd-add-nlm_destroy_host.patch knfsd-lockd-optionally-use-hostnames-for-identifying-peers.patch knfsd-make-nlmclnt_next_cookie-smp-safe.patch knfsd-match-granted_res-replies-using-cookies.patch knfsd-export-nsm_local_state-to-user-space-via-sysctl.patch knfsd-lockd-fix-use-of-h_nextrebind.patch knfsd-register-all-rpc-programs-with-portmapper-by-default.patch - To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html