new helper: iterate_supers()
[safe/jmp/linux-2.6] / fs / nfs / fscache.h
index 099349c..b9c572d 100644 (file)
@@ -74,7 +74,8 @@ extern void nfs_fscache_get_client_cookie(struct nfs_client *);
 extern void nfs_fscache_release_client_cookie(struct nfs_client *);
 
 extern void nfs_fscache_get_super_cookie(struct super_block *,
-                                        struct nfs_parsed_mount_data *);
+                                        const char *,
+                                        struct nfs_clone_mount *);
 extern void nfs_fscache_release_super_cookie(struct super_block *);
 
 extern void nfs_fscache_init_inode_cookie(struct inode *);
@@ -91,6 +92,7 @@ extern int __nfs_readpage_from_fscache(struct nfs_open_context *,
 extern int __nfs_readpages_from_fscache(struct nfs_open_context *,
                                        struct inode *, struct address_space *,
                                        struct list_head *, unsigned *);
+extern void __nfs_readpage_to_fscache(struct inode *, struct page *, int);
 
 /*
  * wait for a page to complete writing to the cache
@@ -140,6 +142,29 @@ static inline int nfs_readpages_from_fscache(struct nfs_open_context *ctx,
        return -ENOBUFS;
 }
 
+/*
+ * Store a page newly fetched from the server in an inode data storage object
+ * in the cache.
+ */
+static inline void nfs_readpage_to_fscache(struct inode *inode,
+                                          struct page *page,
+                                          int sync)
+{
+       if (PageFsCache(page))
+               __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; }
 static inline void nfs_fscache_unregister(void) {}
@@ -149,7 +174,8 @@ static inline void nfs_fscache_release_client_cookie(struct nfs_client *clp) {}
 
 static inline void nfs_fscache_get_super_cookie(
        struct super_block *sb,
-       struct nfs_parsed_mount_data *data)
+       const char *uniq,
+       struct nfs_clone_mount *mntdata)
 {
 }
 static inline void nfs_fscache_release_super_cookie(struct super_block *sb) {}
@@ -184,6 +210,13 @@ static inline int nfs_readpages_from_fscache(struct nfs_open_context *ctx,
 {
        return -ENOBUFS;
 }
+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 */