diff options
author | David Howells <dhowells@redhat.com> | 2009-04-03 11:42:45 -0400 |
---|---|---|
committer | David Howells <dhowells@redhat.com> | 2009-04-03 11:42:45 -0400 |
commit | 7f8e05f60c87646e12c761fef61dd71a7e67112e (patch) | |
tree | f33bfcd5b4662a48890e8245362b381437be76fb /fs/nfs/fscache.h | |
parent | 9a9fc1c03315f1606596e55b4096d39e2079a041 (diff) |
NFS: Store pages from an NFS inode into a local cache
Store pages from an NFS inode into the cache data storage object associated
with that inode.
Signed-off-by: David Howells <dhowells@redhat.com>
Acked-by: Steve Dickson <steved@redhat.com>
Acked-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Acked-by: Al Viro <viro@zeniv.linux.org.uk>
Tested-by: Daire Byrne <Daire.Byrne@framestore.com>
Diffstat (limited to 'fs/nfs/fscache.h')
-rw-r--r-- | fs/nfs/fscache.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/fs/nfs/fscache.h b/fs/nfs/fscache.h index 099349c171ca..1ec3ebb0efcd 100644 --- a/fs/nfs/fscache.h +++ b/fs/nfs/fscache.h | |||
@@ -91,6 +91,7 @@ extern int __nfs_readpage_from_fscache(struct nfs_open_context *, | |||
91 | extern int __nfs_readpages_from_fscache(struct nfs_open_context *, | 91 | extern int __nfs_readpages_from_fscache(struct nfs_open_context *, |
92 | struct inode *, struct address_space *, | 92 | struct inode *, struct address_space *, |
93 | struct list_head *, unsigned *); | 93 | struct list_head *, unsigned *); |
94 | extern void __nfs_readpage_to_fscache(struct inode *, struct page *, int); | ||
94 | 95 | ||
95 | /* | 96 | /* |
96 | * wait for a page to complete writing to the cache | 97 | * wait for a page to complete writing to the cache |
@@ -140,6 +141,19 @@ static inline int nfs_readpages_from_fscache(struct nfs_open_context *ctx, | |||
140 | return -ENOBUFS; | 141 | return -ENOBUFS; |
141 | } | 142 | } |
142 | 143 | ||
144 | /* | ||
145 | * Store a page newly fetched from the server in an inode data storage object | ||
146 | * in the cache. | ||
147 | */ | ||
148 | static inline void nfs_readpage_to_fscache(struct inode *inode, | ||
149 | struct page *page, | ||
150 | int sync) | ||
151 | { | ||
152 | if (PageFsCache(page)) | ||
153 | __nfs_readpage_to_fscache(inode, page, sync); | ||
154 | } | ||
155 | |||
156 | |||
143 | #else /* CONFIG_NFS_FSCACHE */ | 157 | #else /* CONFIG_NFS_FSCACHE */ |
144 | static inline int nfs_fscache_register(void) { return 0; } | 158 | static inline int nfs_fscache_register(void) { return 0; } |
145 | static inline void nfs_fscache_unregister(void) {} | 159 | static inline void nfs_fscache_unregister(void) {} |
@@ -184,6 +198,8 @@ static inline int nfs_readpages_from_fscache(struct nfs_open_context *ctx, | |||
184 | { | 198 | { |
185 | return -ENOBUFS; | 199 | return -ENOBUFS; |
186 | } | 200 | } |
201 | static inline void nfs_readpage_to_fscache(struct inode *inode, | ||
202 | struct page *page, int sync) {} | ||
187 | 203 | ||
188 | #endif /* CONFIG_NFS_FSCACHE */ | 204 | #endif /* CONFIG_NFS_FSCACHE */ |
189 | #endif /* _NFS_FSCACHE_H */ | 205 | #endif /* _NFS_FSCACHE_H */ |