aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/linux/cleancache.h14
1 files changed, 6 insertions, 8 deletions
diff --git a/include/linux/cleancache.h b/include/linux/cleancache.h
index cb3e14234502..fccf7f44139d 100644
--- a/include/linux/cleancache.h
+++ b/include/linux/cleancache.h
@@ -48,14 +48,14 @@ extern void __cleancache_invalidate_fs(struct super_block *);
48 48
49#ifdef CONFIG_CLEANCACHE 49#ifdef CONFIG_CLEANCACHE
50#define cleancache_enabled (1) 50#define cleancache_enabled (1)
51static inline bool cleancache_fs_enabled(struct page *page)
52{
53 return page->mapping->host->i_sb->cleancache_poolid >= 0;
54}
55static inline bool cleancache_fs_enabled_mapping(struct address_space *mapping) 51static inline bool cleancache_fs_enabled_mapping(struct address_space *mapping)
56{ 52{
57 return mapping->host->i_sb->cleancache_poolid >= 0; 53 return mapping->host->i_sb->cleancache_poolid >= 0;
58} 54}
55static inline bool cleancache_fs_enabled(struct page *page)
56{
57 return cleancache_fs_enabled_mapping(page->mapping);
58}
59#else 59#else
60#define cleancache_enabled (0) 60#define cleancache_enabled (0)
61#define cleancache_fs_enabled(_page) (0) 61#define cleancache_fs_enabled(_page) (0)
@@ -89,11 +89,9 @@ static inline void cleancache_init_shared_fs(struct super_block *sb)
89 89
90static inline int cleancache_get_page(struct page *page) 90static inline int cleancache_get_page(struct page *page)
91{ 91{
92 int ret = -1;
93
94 if (cleancache_enabled && cleancache_fs_enabled(page)) 92 if (cleancache_enabled && cleancache_fs_enabled(page))
95 ret = __cleancache_get_page(page); 93 return __cleancache_get_page(page);
96 return ret; 94 return -1;
97} 95}
98 96
99static inline void cleancache_put_page(struct page *page) 97static inline void cleancache_put_page(struct page *page)