From: Bob Liu Date: Tue, 26 Mar 2013 23:24:19 +0000 (+1100) Subject: mm: cleancache: clean up cleancache_enabled X-Git-Tag: next-20130404~3^2~454 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=795989b07c5c6a81fb642c407fbb79f02f1b951c;p=karo-tx-linux.git mm: cleancache: clean up cleancache_enabled cleancache_ops is used to decide whether backend is registered. So now cleancache_enabled is always true if defined CONFIG_CLEANCACHE. Signed-off-by: Bob Liu Cc: Wanpeng Li Cc: Andor Daam Cc: Dan Magenheimer Cc: Florian Schmaus Cc: Konrad Rzeszutek Wilk Cc: Minchan Kim Cc: Stefan Hengelein Signed-off-by: Andrew Morton --- diff --git a/include/linux/cleancache.h b/include/linux/cleancache.h index 3af5ea839558..4ce9056b31a8 100644 --- a/include/linux/cleancache.h +++ b/include/linux/cleancache.h @@ -42,9 +42,9 @@ extern void __cleancache_put_page(struct page *); extern void __cleancache_invalidate_page(struct address_space *, struct page *); extern void __cleancache_invalidate_inode(struct address_space *); extern void __cleancache_invalidate_fs(struct super_block *); -extern int cleancache_enabled; #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; diff --git a/mm/cleancache.c b/mm/cleancache.c index b3ae19b72035..5875f48ce279 100644 --- a/mm/cleancache.c +++ b/mm/cleancache.c @@ -18,16 +18,6 @@ #include #include -/* - * This global enablement flag may be read thousands of times per second - * by cleancache_get/put/invalidate even on systems where cleancache_ops - * is not claimed (e.g. cleancache is config'ed on but remains - * disabled), so is preferred to the slower alternative: a function - * call that checks a non-global. - */ -int cleancache_enabled __read_mostly; -EXPORT_SYMBOL(cleancache_enabled); - /* * cleancache_ops is set by cleancache_ops_register to contain the pointers * to the cleancache "backend" implementation functions. @@ -414,7 +404,6 @@ static int __init init_cleancache(void) fs_poolid_map[i] = FS_UNKNOWN; shared_fs_poolid_map[i] = FS_UNKNOWN; } - cleancache_enabled = 1; return 0; } module_init(init_cleancache)