diff options
author | neilbrown <neilbrown> | 2004-09-06 02:15:04 +0000 |
---|---|---|
committer | neilbrown <neilbrown> | 2004-09-06 02:15:04 +0000 |
commit | af93e0306d87bba3f703386fd6390e9bf8e76816 (patch) | |
tree | ec1caa91d3ccb07af6bd36ff583148390e56ea1d /utils/mountd/rmtab.c | |
parent | 2c91715a9c8dbf18df1666f70e78d6e36e123ca0 (diff) | |
download | nfs-utils-af93e0306d87bba3f703386fd6390e9bf8e76816.tar.gz nfs-utils-af93e0306d87bba3f703386fd6390e9bf8e76816.tar.xz nfs-utils-af93e0306d87bba3f703386fd6390e9bf8e76816.zip |
Support --ha-callout for high-availability callouts
Diffstat (limited to 'utils/mountd/rmtab.c')
-rw-r--r-- | utils/mountd/rmtab.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/utils/mountd/rmtab.c b/utils/mountd/rmtab.c index 844de51..90fbef4 100644 --- a/utils/mountd/rmtab.c +++ b/utils/mountd/rmtab.c @@ -19,6 +19,7 @@ #include "exportfs.h" #include "xio.h" #include "mountd.h" +#include "ha-callout.h" #include <limits.h> /* PATH_MAX */ @@ -61,6 +62,8 @@ mountlist_add(char *host, const char *path) host) == 0 && strcmp(rep->r_path, path) == 0) { rep->r_count++; + /* PRC: do the HA callout: */ + ha_callout("mount", rep->r_client, rep->r_path, rep->r_count); putrmtabent(rep, &pos); endrmtabent(); xfunlock(lockid); @@ -75,6 +78,8 @@ mountlist_add(char *host, const char *path) xe.r_path [sizeof (xe.r_path) - 1] = '\0'; xe.r_count = 1; if (setrmtabent("a")) { + /* PRC: do the HA callout: */ + ha_callout("mount", xe.r_client, xe.r_path, xe.r_count); putrmtabent(&xe, NULL); endrmtabent(); } @@ -103,8 +108,11 @@ mountlist_del(char *hname, const char *path) while ((rep = getrmtabent(1, NULL)) != NULL) { match = !strcmp (rep->r_client, hname) && !strcmp(rep->r_path, path); - if (match) + if (match) { rep->r_count--; + /* PRC: do the HA callout: */ + ha_callout("unmount", rep->r_client, rep->r_path, rep->r_count); + } if (!match || rep->r_count) fputrmtabent(fp, rep, NULL); } |