diff options
author | neilbrown <neilbrown> | 2003-05-21 06:25:15 +0000 |
---|---|---|
committer | neilbrown <neilbrown> | 2003-05-21 06:25:15 +0000 |
commit | 1275be70ca6cd6c4bec07a3381f7b510086c5526 (patch) | |
tree | abf376a1065ae319906ab108bc59095d9a9fe13d /support/nfs/cacheio.c | |
parent | 827f2a0c8c7606ad0245bfa4b9c81075f0de18c7 (diff) | |
download | nfs-utils-1275be70ca6cd6c4bec07a3381f7b510086c5526.tar.gz nfs-utils-1275be70ca6cd6c4bec07a3381f7b510086c5526.tar.xz nfs-utils-1275be70ca6cd6c4bec07a3381f7b510086c5526.zip |
Support new kernel upcalls for export cache management.
Diffstat (limited to 'support/nfs/cacheio.c')
-rw-r--r-- | support/nfs/cacheio.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/support/nfs/cacheio.c b/support/nfs/cacheio.c index 960d801..2af4fa3 100644 --- a/support/nfs/cacheio.c +++ b/support/nfs/cacheio.c @@ -19,6 +19,10 @@ #include <stdio.h> #include <ctype.h> #include <unistd.h> +#include <sys/types.h> +#include <sys/stat.h> +#include <fcntl.h> +#include <time.h> void qword_add(char **bpp, int *lp, char *str) { @@ -214,3 +218,15 @@ int readline(int fd, char **buf, int *lenp) return 1; } + +/* Check if we should use the new caching interface + * This succeeds iff the "nfsd" filesystem is mounted on + * /proc/fs/nfs + */ +int +check_new_cache(void) +{ + struct stat stb; + return (stat("/proc/fs/nfs/filehandle", &stb) == 0); +} + |