diff options
author | Scott Mayhew <smayhew@redhat.com> | 2017-02-15 10:21:40 -0500 |
---|---|---|
committer | Steve Dickson <steved@redhat.com> | 2017-02-15 10:41:59 -0500 |
commit | a15bd948606bf4816bf819c0b0c75761f3eb6359 (patch) | |
tree | b0d721f8b474f26ebe7415ecb3dae7e4a7cace15 /support/nfs | |
parent | 1789737ec6dd43c9d1436aeb6c07fab52206f412 (diff) | |
download | nfs-utils-a15bd948606bf4816bf819c0b0c75761f3eb6359.tar.gz nfs-utils-a15bd948606bf4816bf819c0b0c75761f3eb6359.tar.xz nfs-utils-a15bd948606bf4816bf819c0b0c75761f3eb6359.zip |
mountd/exportfs: implement the -s/--state-directory-path option
Reviewed-by: NeilBrown <neilb@suse.com>
Signed-off-by: Scott Mayhew <smayhew@redhat.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
Diffstat (limited to 'support/nfs')
-rw-r--r-- | support/nfs/cacheio.c | 6 | ||||
-rw-r--r-- | support/nfs/rmtab.c | 4 |
2 files changed, 7 insertions, 3 deletions
diff --git a/support/nfs/cacheio.c b/support/nfs/cacheio.c index e5e2579..9912afa 100644 --- a/support/nfs/cacheio.c +++ b/support/nfs/cacheio.c @@ -27,6 +27,8 @@ #include <time.h> #include <errno.h> +extern struct state_paths etab; + void qword_add(char **bpp, int *lp, char *str) { char *bp = *bpp; @@ -199,7 +201,7 @@ int qword_get_uint(char **bpp, unsigned int *anint) } /* flush the kNFSd caches. - * Set the flush time to the mtime of _PATH_ETAB or + * Set the flush time to the mtime of the etab state file or * if force, to now. * the caches to flush are: * auth.unix.ip nfsd.export nfsd.fh @@ -228,7 +230,7 @@ cache_flush(int force) }; now = time(0); if (force || - stat(_PATH_ETAB, &stb) != 0 || + stat(etab.statefn, &stb) != 0 || stb.st_mtime > now) stb.st_mtime = time(0); diff --git a/support/nfs/rmtab.c b/support/nfs/rmtab.c index 59dfbdf..2ecb2cc 100644 --- a/support/nfs/rmtab.c +++ b/support/nfs/rmtab.c @@ -33,12 +33,14 @@ static FILE *rmfp = NULL; +extern struct state_paths rmtab; + int setrmtabent(char *type) { if (rmfp) fclose(rmfp); - rmfp = fsetrmtabent(_PATH_RMTAB, type); + rmfp = fsetrmtabent(rmtab.statefn, type); return (rmfp != NULL); } |