2 * Copyright (C) 1995, 1997-1999 Jeffrey A. Uphoff
3 * Modified by Olaf Kirch, Oct. 1996.
4 * Modified by Lon Hohberger, Oct. 2000.
13 /* Callback notify list. */
14 /* notify_list *cbnl = NULL; ... never used */
18 * Services SM_NOTIFY requests.
19 * Any clients that have asked us to monitor that host are put on
20 * the global callback list, which is processed as soon as statd
24 sm_notify_1_svc(struct stat_chge *argp, struct svc_req *rqstp)
26 notify_list *lp, *call;
27 static char *result = NULL;
29 dprintf(N_DEBUG, "Received SM_NOTIFY from %s, state: %d",
30 argp->mon_name, argp->state);
32 /* quick check - don't bother if we're not monitoring anyone */
33 /* LH - this was != MULL, meaning that if anyone _was_ in our RTNL,
34 * we'd never pass this point. */
36 note(N_WARNING, "SM_NOTIFY from %s while not monitoring any hosts.",
37 argp->mon_name, argp->state);
38 return ((void *) &result);
41 /* okir change: statd doesn't remove the remote host from its
42 * internal monitor list when receiving an SM_NOTIFY call from
43 * it. Lockd will want to continue monitoring the remote host
44 * until it issues an SM_UNMON call.
46 while ((lp = nlist_gethost(lp, argp->mon_name, 0)) != NULL) {
47 if (NL_STATE(lp) != argp->state) {
48 NL_STATE(lp) = argp->state;
49 call = nlist_clone(lp);
50 NL_TYPE(call) = NOTIFY_CALLBACK;
51 nlist_insert(¬ify, call);
56 return ((void *) &result);