]> git.karo-electronics.de Git - karo-tx-linux.git/commit
block: use kmalloc alignment for bio slab
authorMikulas Patocka <mpatocka@redhat.com>
Fri, 28 Mar 2014 19:51:55 +0000 (15:51 -0400)
committerMike Snitzer <snitzer@redhat.com>
Wed, 28 May 2014 18:02:09 +0000 (14:02 -0400)
commit39146b2dad83f8820818428f35cb89280bdb685c
tree40985640265bd9bc8d315a49fa448966ea537061
parent751fa24f248259c578a408bd03ba4fb99048b0d7
block: use kmalloc alignment for bio slab

Various subsystems can ask the bio subsystem to create a bio slab cache
with some free space before the bio.  This free space can be used for any
purpose.  Device mapper uses this per-bio-data feature to place some
target-specific and device-mapper specific data before the bio, so that
the target-specific data doesn't have to be allocated separately.

This per-bio-data mechanism is used in place of kmalloc, so we need the
allocated slab to have the same memory alignment as memory allocated
with kmalloc.

Change bio_find_or_create_slab() so that it uses ARCH_KMALLOC_MINALIGN
alignment when creating the slab cache.  This is needed so that dm-crypt
can use per-bio-data for encryption - the crypto subsystem assumes this
data will have the same alignment as kmalloc'ed memory.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Acked-by: Jens Axboe <axboe@fb.com>
fs/bio.c