summaryrefslogtreecommitdiff
path: root/fs/ext4
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2026-02-21 16:37:42 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2026-02-21 17:09:51 -0800
commitbf4afc53b77aeaa48b5409da5c8da6bb4eff7f43 (patch)
tree01fdd9d27f1b272bef0127966e08eac44d134d0a /fs/ext4
parente19e1b480ac73c3e62ffebbca1174f0f511f43e7 (diff)
Convert 'alloc_obj' family to use the new default GFP_KERNEL argument
This was done entirely with mindless brute force, using git grep -l '\<k[vmz]*alloc_objs*(.*, GFP_KERNEL)' | xargs sed -i 's/\(alloc_objs*(.*\), GFP_KERNEL)/\1)/' to convert the new alloc_obj() users that had a simple GFP_KERNEL argument to just drop that argument. Note that due to the extreme simplicity of the scripting, any slightly more complex cases spread over multiple lines would not be triggered: they definitely exist, but this covers the vast bulk of the cases, and the resulting diff is also then easier to check automatically. For the same reason the 'flex' versions will be done as a separate conversion. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/ext4')
-rw-r--r--fs/ext4/block_validity.c2
-rw-r--r--fs/ext4/dir.c2
-rw-r--r--fs/ext4/extents-test.c4
-rw-r--r--fs/ext4/mballoc-test.c12
-rw-r--r--fs/ext4/mballoc.c4
-rw-r--r--fs/ext4/resize.c2
-rw-r--r--fs/ext4/super.c16
-rw-r--r--fs/ext4/sysfs.c2
8 files changed, 22 insertions, 22 deletions
diff --git a/fs/ext4/block_validity.c b/fs/ext4/block_validity.c
index 75179be4a488..3a31e3d718c9 100644
--- a/fs/ext4/block_validity.c
+++ b/fs/ext4/block_validity.c
@@ -217,7 +217,7 @@ int ext4_setup_system_zone(struct super_block *sb)
ext4_group_t i;
int ret;
- system_blks = kzalloc_obj(*system_blks, GFP_KERNEL);
+ system_blks = kzalloc_obj(*system_blks);
if (!system_blks)
return -ENOMEM;
diff --git a/fs/ext4/dir.c b/fs/ext4/dir.c
index b285ce18b183..36dc53df0fb2 100644
--- a/fs/ext4/dir.c
+++ b/fs/ext4/dir.c
@@ -672,7 +672,7 @@ static int ext4_dir_open(struct inode *inode, struct file *file)
{
struct dir_private_info *info;
- info = kzalloc_obj(*info, GFP_KERNEL);
+ info = kzalloc_obj(*info);
if (!info)
return -ENOMEM;
file->private_data = info;
diff --git a/fs/ext4/extents-test.c b/fs/ext4/extents-test.c
index 913103089799..7c4690eb7dad 100644
--- a/fs/ext4/extents-test.c
+++ b/fs/ext4/extents-test.c
@@ -229,7 +229,7 @@ static int extents_kunit_init(struct kunit *test)
sb->s_blocksize = 4096;
sb->s_blocksize_bits = 12;
- sbi = kzalloc_obj(struct ext4_sb_info, GFP_KERNEL);
+ sbi = kzalloc_obj(struct ext4_sb_info);
if (sbi == NULL)
return -ENOMEM;
@@ -240,7 +240,7 @@ static int extents_kunit_init(struct kunit *test)
sbi->s_extent_max_zeroout_kb = 32;
/* setup the mock inode */
- k_ctx.k_ei = kzalloc_obj(struct ext4_inode_info, GFP_KERNEL);
+ k_ctx.k_ei = kzalloc_obj(struct ext4_inode_info);
if (k_ctx.k_ei == NULL)
return -ENOMEM;
ei = k_ctx.k_ei;
diff --git a/fs/ext4/mballoc-test.c b/fs/ext4/mballoc-test.c
index 6b448aad6f63..9fbdf6a09489 100644
--- a/fs/ext4/mballoc-test.c
+++ b/fs/ext4/mballoc-test.c
@@ -34,7 +34,7 @@ static struct inode *mbt_alloc_inode(struct super_block *sb)
{
struct ext4_inode_info *ei;
- ei = kmalloc_obj(struct ext4_inode_info, GFP_KERNEL);
+ ei = kmalloc_obj(struct ext4_inode_info);
if (!ei)
return NULL;
@@ -73,11 +73,11 @@ static int mbt_mb_init(struct super_block *sb)
int ret;
/* needed by ext4_mb_init->bdev_nonrot(sb->s_bdev) */
- sb->s_bdev = kzalloc_obj(*sb->s_bdev, GFP_KERNEL);
+ sb->s_bdev = kzalloc_obj(*sb->s_bdev);
if (sb->s_bdev == NULL)
return -ENOMEM;
- sb->s_bdev->bd_queue = kzalloc_obj(struct request_queue, GFP_KERNEL);
+ sb->s_bdev->bd_queue = kzalloc_obj(struct request_queue);
if (sb->s_bdev->bd_queue == NULL) {
kfree(sb->s_bdev);
return -ENOMEM;
@@ -137,7 +137,7 @@ static struct super_block *mbt_ext4_alloc_super_block(void)
struct super_block *sb;
struct ext4_sb_info *sbi;
- fsb = kzalloc_obj(*fsb, GFP_KERNEL);
+ fsb = kzalloc_obj(*fsb);
if (fsb == NULL)
return NULL;
@@ -148,7 +148,7 @@ static struct super_block *mbt_ext4_alloc_super_block(void)
sbi = &fsb->sbi;
sbi->s_blockgroup_lock =
- kzalloc_obj(struct blockgroup_lock, GFP_KERNEL);
+ kzalloc_obj(struct blockgroup_lock);
if (!sbi->s_blockgroup_lock)
goto out_deactivate;
@@ -252,7 +252,7 @@ static int mbt_ctx_init(struct super_block *sb)
struct mbt_ctx *ctx = MBT_CTX(sb);
ext4_group_t i, ngroups = ext4_get_groups_count(sb);
- ctx->grp_ctx = kzalloc_objs(struct mbt_grp_ctx, ngroups, GFP_KERNEL);
+ ctx->grp_ctx = kzalloc_objs(struct mbt_grp_ctx, ngroups);
if (ctx->grp_ctx == NULL)
return -ENOMEM;
diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
index 4d0bf2fcf2d3..b6d59385e13d 100644
--- a/fs/ext4/mballoc.c
+++ b/fs/ext4/mballoc.c
@@ -3754,7 +3754,7 @@ int ext4_mb_init(struct super_block *sb)
} while (i < MB_NUM_ORDERS(sb));
sbi->s_mb_avg_fragment_size =
- kmalloc_objs(struct xarray, MB_NUM_ORDERS(sb), GFP_KERNEL);
+ kmalloc_objs(struct xarray, MB_NUM_ORDERS(sb));
if (!sbi->s_mb_avg_fragment_size) {
ret = -ENOMEM;
goto out;
@@ -3763,7 +3763,7 @@ int ext4_mb_init(struct super_block *sb)
xa_init(&sbi->s_mb_avg_fragment_size[i]);
sbi->s_mb_largest_free_orders =
- kmalloc_objs(struct xarray, MB_NUM_ORDERS(sb), GFP_KERNEL);
+ kmalloc_objs(struct xarray, MB_NUM_ORDERS(sb));
if (!sbi->s_mb_largest_free_orders) {
ret = -ENOMEM;
goto out;
diff --git a/fs/ext4/resize.c b/fs/ext4/resize.c
index 780679645b6e..2c5b851c552a 100644
--- a/fs/ext4/resize.c
+++ b/fs/ext4/resize.c
@@ -32,7 +32,7 @@ static void ext4_rcu_ptr_callback(struct rcu_head *head)
void ext4_kvfree_array_rcu(void *to_free)
{
- struct ext4_rcu_ptr *ptr = kzalloc_obj(*ptr, GFP_KERNEL);
+ struct ext4_rcu_ptr *ptr = kzalloc_obj(*ptr);
if (ptr) {
ptr->ptr = to_free;
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 63784d9b1874..43f680c750ae 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -2016,7 +2016,7 @@ int ext4_init_fs_context(struct fs_context *fc)
{
struct ext4_fs_context *ctx;
- ctx = kzalloc_obj(struct ext4_fs_context, GFP_KERNEL);
+ ctx = kzalloc_obj(struct ext4_fs_context);
if (!ctx)
return -ENOMEM;
@@ -2496,11 +2496,11 @@ static int parse_apply_sb_mount_options(struct super_block *sb,
if (strscpy_pad(s_mount_opts, sbi->s_es->s_mount_opts) < 0)
return -E2BIG;
- fc = kzalloc_obj(struct fs_context, GFP_KERNEL);
+ fc = kzalloc_obj(struct fs_context);
if (!fc)
return -ENOMEM;
- s_ctx = kzalloc_obj(struct ext4_fs_context, GFP_KERNEL);
+ s_ctx = kzalloc_obj(struct ext4_fs_context);
if (!s_ctx)
goto out_free;
@@ -3962,7 +3962,7 @@ static int ext4_li_info_new(void)
{
struct ext4_lazy_init *eli = NULL;
- eli = kzalloc_obj(*eli, GFP_KERNEL);
+ eli = kzalloc_obj(*eli);
if (!eli)
return -ENOMEM;
@@ -3981,7 +3981,7 @@ static struct ext4_li_request *ext4_li_request_new(struct super_block *sb,
{
struct ext4_li_request *elr;
- elr = kzalloc_obj(*elr, GFP_KERNEL);
+ elr = kzalloc_obj(*elr);
if (!elr)
return NULL;
@@ -4328,7 +4328,7 @@ static struct ext4_sb_info *ext4_alloc_sbi(struct super_block *sb)
{
struct ext4_sb_info *sbi;
- sbi = kzalloc_obj(*sbi, GFP_KERNEL);
+ sbi = kzalloc_obj(*sbi);
if (!sbi)
return NULL;
@@ -4336,7 +4336,7 @@ static struct ext4_sb_info *ext4_alloc_sbi(struct super_block *sb)
NULL, NULL);
sbi->s_blockgroup_lock =
- kzalloc_obj(struct blockgroup_lock, GFP_KERNEL);
+ kzalloc_obj(struct blockgroup_lock);
if (!sbi->s_blockgroup_lock)
goto err_out;
@@ -4879,7 +4879,7 @@ static int ext4_group_desc_init(struct super_block *sb,
}
}
rcu_assign_pointer(sbi->s_group_desc,
- kvmalloc_objs(struct buffer_head *, db_count, GFP_KERNEL));
+ kvmalloc_objs(struct buffer_head *, db_count));
if (sbi->s_group_desc == NULL) {
ext4_msg(sb, KERN_ERR, "not enough memory");
return -ENOMEM;
diff --git a/fs/ext4/sysfs.c b/fs/ext4/sysfs.c
index cdf78da85861..b87d7bdab06a 100644
--- a/fs/ext4/sysfs.c
+++ b/fs/ext4/sysfs.c
@@ -655,7 +655,7 @@ int __init ext4_init_sysfs(void)
if (!ext4_root)
return -ENOMEM;
- ext4_feat = kzalloc_obj(*ext4_feat, GFP_KERNEL);
+ ext4_feat = kzalloc_obj(*ext4_feat);
if (!ext4_feat) {
ret = -ENOMEM;
goto root_err;