]> Git Repo - linux.git/commit
fs, jfs: remove slab object constructor
authorDavid Rientjes <[email protected]>
Wed, 15 Apr 2015 23:14:11 +0000 (16:14 -0700)
committerLinus Torvalds <[email protected]>
Wed, 15 Apr 2015 23:35:18 +0000 (16:35 -0700)
commitee1462458cb543bbcfd379176bbba0d4bd052b7f
tree927fa8fa3cfbb8c659a5f70c70924fc719b296b4
parent4db0c3c2983cc6b7a08a33542af5e14de8a9258c
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 <[email protected]>
Acked-by: Dave Kleikamp <[email protected]>
Cc: Christoph Hellwig <[email protected]>
Cc: Sebastian Ott <[email protected]>
Cc: Mikulas Patocka <[email protected]>
Cc: Catalin Marinas <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
fs/jfs/jfs_metapage.c
fs/jfs/jfs_metapage.h
This page took 0.053481 seconds and 4 git commands to generate.