summaryrefslogtreecommitdiff
path: root/fs/jfs/jfs_metapage.h
diff options
context:
space:
mode:
authorDavid Rientjes <rientjes@google.com>2015-04-15 16:14:11 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2015-04-15 16:35:18 -0700
commitee1462458cb543bbcfd379176bbba0d4bd052b7f (patch)
tree927fa8fa3cfbb8c659a5f70c70924fc719b296b4 /fs/jfs/jfs_metapage.h
parent4db0c3c2983cc6b7a08a33542af5e14de8a9258c (diff)
fs, jfs: remove slab object constructor
Mempools based on slab caches with object constructors are risky because element allocation can happen either from the slab cache itself, meaning the constructor is properly called before returning, or from the mempool reserve pool, meaning the constructor is not called before returning, depending on the allocation context. For this reason, we should disallow creating mempools based on slab caches that have object constructors. Callers of mempool_alloc() will be responsible for properly initializing the returned element. Then, it doesn't matter if the element came from the slab cache or the mempool reserved pool. The only occurrence of a mempool being based on a slab cache with an object constructor in the tree is in fs/jfs/jfs_metapage.c. Remove it and properly initialize the element in alloc_metapage(). At the same time, META_free is never used, so remove it as well. Signed-off-by: David Rientjes <rientjes@google.com> Acked-by: Dave Kleikamp <dave.kleikamp@oracle.com> Cc: Christoph Hellwig <hch@lst.de> Cc: Sebastian Ott <sebott@linux.vnet.ibm.com> Cc: Mikulas Patocka <mpatocka@redhat.com> Cc: Catalin Marinas <catalin.marinas@arm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/jfs/jfs_metapage.h')
-rw-r--r--fs/jfs/jfs_metapage.h1
1 files changed, 0 insertions, 1 deletions
diff --git a/fs/jfs/jfs_metapage.h b/fs/jfs/jfs_metapage.h
index a78beda85f68..337e9e51ac06 100644
--- a/fs/jfs/jfs_metapage.h
+++ b/fs/jfs/jfs_metapage.h
@@ -48,7 +48,6 @@ struct metapage {
/* metapage flag */
#define META_locked 0
-#define META_free 1
#define META_dirty 2
#define META_sync 3
#define META_discard 4