diff options
author | Bob Liu <lliubbo@gmail.com> | 2013-04-30 18:26:58 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-04-30 20:04:01 -0400 |
commit | ff610a1d55da22bf95bbc6a8b193e052169b34b7 (patch) | |
tree | 0c96ecc78d4d3818825f74871357b94134a22eac | |
parent | 833f8662af9659508afc3cb80f09138eade378e2 (diff) |
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 <lliubbo@gmail.com>
Cc: Wanpeng Li <liwanp@linux.vnet.ibm.com>
Cc: Andor Daam <andor.daam@googlemail.com>
Cc: Dan Magenheimer <dan.magenheimer@oracle.com>
Cc: Florian Schmaus <fschmaus@gmail.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Stefan Hengelein <ilendir@googlemail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | include/linux/cleancache.h | 2 | ||||
-rw-r--r-- | mm/cleancache.c | 11 |
2 files changed, 1 insertions, 12 deletions
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 *); | |||
42 | extern void __cleancache_invalidate_page(struct address_space *, struct page *); | 42 | extern void __cleancache_invalidate_page(struct address_space *, struct page *); |
43 | extern void __cleancache_invalidate_inode(struct address_space *); | 43 | extern void __cleancache_invalidate_inode(struct address_space *); |
44 | extern void __cleancache_invalidate_fs(struct super_block *); | 44 | extern void __cleancache_invalidate_fs(struct super_block *); |
45 | extern int cleancache_enabled; | ||
46 | 45 | ||
47 | #ifdef CONFIG_CLEANCACHE | 46 | #ifdef CONFIG_CLEANCACHE |
47 | #define cleancache_enabled (1) | ||
48 | static inline bool cleancache_fs_enabled(struct page *page) | 48 | static inline bool cleancache_fs_enabled(struct page *page) |
49 | { | 49 | { |
50 | return page->mapping->host->i_sb->cleancache_poolid >= 0; | 50 | 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 | |||
@@ -19,16 +19,6 @@ | |||
19 | #include <linux/cleancache.h> | 19 | #include <linux/cleancache.h> |
20 | 20 | ||
21 | /* | 21 | /* |
22 | * This global enablement flag may be read thousands of times per second | ||
23 | * by cleancache_get/put/invalidate even on systems where cleancache_ops | ||
24 | * is not claimed (e.g. cleancache is config'ed on but remains | ||
25 | * disabled), so is preferred to the slower alternative: a function | ||
26 | * call that checks a non-global. | ||
27 | */ | ||
28 | int cleancache_enabled __read_mostly; | ||
29 | EXPORT_SYMBOL(cleancache_enabled); | ||
30 | |||
31 | /* | ||
32 | * cleancache_ops is set by cleancache_ops_register to contain the pointers | 22 | * cleancache_ops is set by cleancache_ops_register to contain the pointers |
33 | * to the cleancache "backend" implementation functions. | 23 | * to the cleancache "backend" implementation functions. |
34 | */ | 24 | */ |
@@ -414,7 +404,6 @@ static int __init init_cleancache(void) | |||
414 | fs_poolid_map[i] = FS_UNKNOWN; | 404 | fs_poolid_map[i] = FS_UNKNOWN; |
415 | shared_fs_poolid_map[i] = FS_UNKNOWN; | 405 | shared_fs_poolid_map[i] = FS_UNKNOWN; |
416 | } | 406 | } |
417 | cleancache_enabled = 1; | ||
418 | return 0; | 407 | return 0; |
419 | } | 408 | } |
420 | module_init(init_cleancache) | 409 | module_init(init_cleancache) |