]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
mm: cleancache: clean up cleancache_enabled
authorBob Liu <lliubbo@gmail.com>
Tue, 30 Apr 2013 22:26:58 +0000 (15:26 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 1 May 2013 00:04:01 +0000 (17:04 -0700)
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>
include/linux/cleancache.h
mm/cleancache.c

index 3af5ea839558364b8b79e653a8b97135c700ea2d..4ce9056b31a8d96f5d8b2696555eea2dbffd45a3 100644 (file)
@@ -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;
index b3ae19b72035f36efc1f2e6d30199c933ba6a087..5875f48ce27954821bec4c57b21bde2b9ea450f0 100644 (file)
 #include <linux/debugfs.h>
 #include <linux/cleancache.h>
 
-/*
- * 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)