X-Git-Url: https://git.decadent.org.uk/gitweb/?p=nfs-utils.git;a=blobdiff_plain;f=support%2Fnfs%2Fcacheio.c;h=2af4fa3e3e8ce58b319c06cbb0253f2aca792221;hp=960d801f6fb1c489fe445ff7f026d96c6efeba10;hb=1275be70ca6cd6c4bec07a3381f7b510086c5526;hpb=827f2a0c8c7606ad0245bfa4b9c81075f0de18c7 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 #include #include +#include +#include +#include +#include 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); +} +