summaryrefslogtreecommitdiff
path: root/fs/cifs/fscache.h
diff options
context:
space:
mode:
authorSuresh Jayaraman <sjayaraman@suse.de>2010-07-05 18:13:00 +0530
committerSteve French <sfrench@us.ibm.com>2010-08-02 12:40:36 +0000
commit85f2d6b44d7e83bdeab87df910127c6f296866cf (patch)
tree238389c1726e212a80336551809b44b0bbedec38 /fs/cifs/fscache.h
parent9451a9a52f91a4c171cfaca2f6d7a2ce91867b8d (diff)
downloadlwn-85f2d6b44d7e83bdeab87df910127c6f296866cf.tar.gz
lwn-85f2d6b44d7e83bdeab87df910127c6f296866cf.zip
cifs: FS-Cache page management
Takes care of invalidation and release of FS-Cache marked pages and also invalidation of the FsCache page flag when the inode is removed. Signed-off-by: Suresh Jayaraman <sjayaraman@suse.de> Acked-by: David Howells <dhowells@redhat.com> Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs/fscache.h')
-rw-r--r--fs/cifs/fscache.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/fs/cifs/fscache.h b/fs/cifs/fscache.h
index 1008f4050835..5e18a21eee9d 100644
--- a/fs/cifs/fscache.h
+++ b/fs/cifs/fscache.h
@@ -48,6 +48,16 @@ extern void cifs_fscache_release_inode_cookie(struct inode *);
extern void cifs_fscache_set_inode_cookie(struct inode *, struct file *);
extern void cifs_fscache_reset_inode_cookie(struct inode *);
+extern void __cifs_fscache_invalidate_page(struct page *, struct inode *);
+extern int cifs_fscache_release_page(struct page *page, gfp_t gfp);
+
+static inline void cifs_fscache_invalidate_page(struct page *page,
+ struct inode *inode)
+{
+ if (PageFsCache(page))
+ __cifs_fscache_invalidate_page(page, inode);
+}
+
#else /* CONFIG_CIFS_FSCACHE */
static inline int cifs_fscache_register(void) { return 0; }
static inline void cifs_fscache_unregister(void) {}
@@ -64,7 +74,13 @@ static inline void cifs_fscache_release_inode_cookie(struct inode *inode) {}
static inline void cifs_fscache_set_inode_cookie(struct inode *inode,
struct file *filp) {}
static inline void cifs_fscache_reset_inode_cookie(struct inode *inode) {}
+static inline void cifs_fscache_release_page(struct page *page, gfp_t gfp)
+{
+ return 1; /* May release page */
+}
+static inline int cifs_fscache_invalidate_page(struct page *page,
+ struct inode *) {}
#endif /* CONFIG_CIFS_FSCACHE */