From 5d1acff159730770cbab68b19443518c92ab1000 Mon Sep 17 00:00:00 2001 From: David Howells Date: Fri, 3 Apr 2009 16:42:47 +0100 Subject: NFS: Display local caching state Display the local caching state in /proc/fs/nfsfs/volumes. Signed-off-by: David Howells Acked-by: Steve Dickson Acked-by: Trond Myklebust Acked-by: Al Viro Tested-by: Daire Byrne --- fs/nfs/fscache.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'fs/nfs/fscache.h') diff --git a/fs/nfs/fscache.h b/fs/nfs/fscache.h index 1ec3ebb0efcd..6e809bb0ff08 100644 --- a/fs/nfs/fscache.h +++ b/fs/nfs/fscache.h @@ -153,6 +153,16 @@ static inline void nfs_readpage_to_fscache(struct inode *inode, __nfs_readpage_to_fscache(inode, page, sync); } +/* + * indicate the client caching state as readable text + */ +static inline const char *nfs_server_fscache_state(struct nfs_server *server) +{ + if (server->fscache && (server->options & NFS_OPTION_FSCACHE)) + return "yes"; + return "no "; +} + #else /* CONFIG_NFS_FSCACHE */ static inline int nfs_fscache_register(void) { return 0; } @@ -201,5 +211,10 @@ static inline int nfs_readpages_from_fscache(struct nfs_open_context *ctx, static inline void nfs_readpage_to_fscache(struct inode *inode, struct page *page, int sync) {} +static inline const char *nfs_server_fscache_state(struct nfs_server *server) +{ + return "no "; +} + #endif /* CONFIG_NFS_FSCACHE */ #endif /* _NFS_FSCACHE_H */ -- cgit v1.2.3