summaryrefslogtreecommitdiffstats
path: root/support/nfs/cacheio.c
diff options
context:
space:
mode:
authorneilbrown <neilbrown>2003-05-21 06:25:15 +0000
committerneilbrown <neilbrown>2003-05-21 06:25:15 +0000
commit1275be70ca6cd6c4bec07a3381f7b510086c5526 (patch)
treeabf376a1065ae319906ab108bc59095d9a9fe13d /support/nfs/cacheio.c
parent827f2a0c8c7606ad0245bfa4b9c81075f0de18c7 (diff)
downloadnfs-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.c16
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);
+}
+