]> git.pld-linux.org Git - packages/kernel.git/blame - bio-kmalloc-align.patch
- fix vserver patch for 3.14.5
[packages/kernel.git] / bio-kmalloc-align.patch
CommitLineData
0a2e4279
ŁK
1bio: use kmalloc alignment for bio slab
2
3Various subsystems can ask the bio subsystem to create a bio slab cache
4with some free space before the bio. This free space can be used for any
5purpose. Device mapper uses this feature to place some target-specific and
6device-mapper specific data before the bio, so that the target-specific
7data doesn't have to be allocated separatedly.
8
9This mechanism is used in place of kmalloc, so we need that the allocated
10slab have the same memory alignment as memory allocated with kmalloc.
11
12This patch changes the function bio_find_or_create_slab so that it uses
13ARCH_KMALLOC_MINALIGN alignment when creating the slab cache. This patch
14is needed so that dm-crypt can use per-bio data for encryption - the
15crypto subsystem assumes that these data have the same alignment as
16kmallocated memory.
17
18Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
19
20---
21 fs/bio.c | 3 ++-
22 1 file changed, 2 insertions(+), 1 deletion(-)
23
24Index: linux-3.14-rc3/fs/bio.c
25===================================================================
26--- linux-3.14-rc3.orig/fs/bio.c 2014-02-23 23:53:50.000000000 +0100
27+++ linux-3.14-rc3/fs/bio.c 2014-02-23 23:55:00.000000000 +0100
28@@ -112,7 +112,8 @@ static struct kmem_cache *bio_find_or_cr
29 bslab = &bio_slabs[entry];
30
31 snprintf(bslab->name, sizeof(bslab->name), "bio-%d", entry);
32- slab = kmem_cache_create(bslab->name, sz, 0, SLAB_HWCACHE_ALIGN, NULL);
33+ slab = kmem_cache_create(bslab->name, sz, ARCH_KMALLOC_MINALIGN,
34+ SLAB_HWCACHE_ALIGN, NULL);
35 if (!slab)
36 goto out_unlock;
37
This page took 0.035257 seconds and 4 git commands to generate.