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