Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ext4: replace kmem_cache_create with KMEM_CACHE

Replace kmem_cache_create with KMEM_CACHE macro that
guaranteed struct alignment

Signed-off-by: JunChao Sun <sunjunchao2870@gmail.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Link: https://lore.kernel.org/r/20221109153822.80250-1-sunjunchao2870@gmail.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>

authored by

JunChao Sun and committed by
Theodore Ts'o
060f7739 89481b5f

+4 -9
+2 -6
fs/ext4/extents_status.c
··· 155 155 156 156 int __init ext4_init_es(void) 157 157 { 158 - ext4_es_cachep = kmem_cache_create("ext4_extent_status", 159 - sizeof(struct extent_status), 160 - 0, (SLAB_RECLAIM_ACCOUNT), NULL); 158 + ext4_es_cachep = KMEM_CACHE(extent_status, SLAB_RECLAIM_ACCOUNT); 161 159 if (ext4_es_cachep == NULL) 162 160 return -ENOMEM; 163 161 return 0; ··· 1805 1807 1806 1808 int __init ext4_init_pending(void) 1807 1809 { 1808 - ext4_pending_cachep = kmem_cache_create("ext4_pending_reservation", 1809 - sizeof(struct pending_reservation), 1810 - 0, (SLAB_RECLAIM_ACCOUNT), NULL); 1810 + ext4_pending_cachep = KMEM_CACHE(pending_reservation, SLAB_RECLAIM_ACCOUNT); 1811 1811 if (ext4_pending_cachep == NULL) 1812 1812 return -ENOMEM; 1813 1813 return 0;
+2 -3
fs/ext4/readpage.c
··· 410 410 411 411 int __init ext4_init_post_read_processing(void) 412 412 { 413 - bio_post_read_ctx_cache = 414 - kmem_cache_create("ext4_bio_post_read_ctx", 415 - sizeof(struct bio_post_read_ctx), 0, 0, NULL); 413 + bio_post_read_ctx_cache = KMEM_CACHE(bio_post_read_ctx, SLAB_RECLAIM_ACCOUNT); 414 + 416 415 if (!bio_post_read_ctx_cache) 417 416 goto fail; 418 417 bio_post_read_ctx_pool =