diff options
author | David S. Miller <davem@davemloft.net> | 2016-02-01 18:44:07 -0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-02-01 18:44:07 -0800 |
commit | b45efa30a626e915192a6c548cd8642379cd47cc (patch) | |
tree | 90d8b43ebceb850b0e7852d75283aebbd2abbc00 /include/linux/cleancache.h | |
parent | 7a26019fdecdb45ff784ae4e3b7e0cc9045100ca (diff) | |
parent | 34229b277480f46c1e9a19f027f30b074512e68b (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Diffstat (limited to 'include/linux/cleancache.h')
-rw-r--r-- | include/linux/cleancache.h | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/include/linux/cleancache.h b/include/linux/cleancache.h index bda5ec0b4b4d..fccf7f44139d 100644 --- a/include/linux/cleancache.h +++ b/include/linux/cleancache.h @@ -37,7 +37,7 @@ struct cleancache_ops { void (*invalidate_fs)(int); }; -extern int cleancache_register_ops(struct cleancache_ops *ops); +extern int cleancache_register_ops(const struct cleancache_ops *ops); extern void __cleancache_init_fs(struct super_block *); extern void __cleancache_init_shared_fs(struct super_block *); extern int __cleancache_get_page(struct page *); @@ -48,14 +48,14 @@ extern void __cleancache_invalidate_fs(struct super_block *); #ifdef CONFIG_CLEANCACHE #define cleancache_enabled (1) -static inline bool cleancache_fs_enabled(struct page *page) -{ - return page->mapping->host->i_sb->cleancache_poolid >= 0; -} static inline bool cleancache_fs_enabled_mapping(struct address_space *mapping) { return mapping->host->i_sb->cleancache_poolid >= 0; } +static inline bool cleancache_fs_enabled(struct page *page) +{ + return cleancache_fs_enabled_mapping(page->mapping); +} #else #define cleancache_enabled (0) #define cleancache_fs_enabled(_page) (0) @@ -89,11 +89,9 @@ static inline void cleancache_init_shared_fs(struct super_block *sb) static inline int cleancache_get_page(struct page *page) { - int ret = -1; - if (cleancache_enabled && cleancache_fs_enabled(page)) - ret = __cleancache_get_page(page); - return ret; + return __cleancache_get_page(page); + return -1; } static inline void cleancache_put_page(struct page *page) |