]> git.decadent.org.uk Git - nfs-utils.git/blobdiff - utils/statd/monitor.c
Support --ha-callout for high-availability callouts
[nfs-utils.git] / utils / statd / monitor.c
index 8c1bb50ef98a076aadb00ecc3dbf2f66882e3a28..3b81bdd4af1a6cc829cc9efc0d6a2c8e5ddd3d11 100644 (file)
@@ -19,6 +19,7 @@
 #include "misc.h"
 #include "statd.h"
 #include "notlist.h"
+#include "ha-callout.h"
 
 notify_list *          rtnl = NULL;    /* Run-time notify list. */
 
@@ -177,6 +178,8 @@ sm_mon_1_svc(struct mon *argp, struct svc_req *rqstp)
                goto failure;
        }
        free(path);
+       /* PRC: do the HA callout: */
+       ha_callout("add-client", mon_name, my_name, -1);
        nlist_insert(&rtnl, clnt);
        close(fd);
 
@@ -232,6 +235,10 @@ sm_unmon_1_svc(struct mon_id *argp, struct svc_req *rqstp)
                        /* Match! */
                        dprintf(N_DEBUG, "UNMONITORING %s for %s",
                                        mon_name, my_name);
+
+                       /* PRC: do the HA callout: */
+                       ha_callout("del-client", mon_name, my_name, -1);
+
                        nlist_free(&rtnl, clnt);
                        xunlink(SM_DIR, mon_name, 1);
 
@@ -276,6 +283,8 @@ sm_unmon_all_1_svc(struct my_id *argp, struct svc_req *rqstp)
                                sizeof (mon_name) - 1);
                        mon_name[sizeof (mon_name) - 1] = '\0';
                        temp = NL_NEXT(clnt);
+                       /* PRC: do the HA callout: */
+                       ha_callout("del-client", mon_name, argp->my_name, -1);
                        nlist_free(&rtnl, clnt);
                        xunlink(SM_DIR, mon_name, 1);
                        ++count;