]> git.decadent.org.uk Git - nfs-utils.git/blobdiff - support/nfs/cacheio.c
Support new kernel upcalls for export cache management.
[nfs-utils.git] / support / nfs / cacheio.c
index 960d801f6fb1c489fe445ff7f026d96c6efeba10..2af4fa3e3e8ce58b319c06cbb0253f2aca792221 100644 (file)
 #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);
+}      
+