diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2026-02-21 16:37:42 -0800 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2026-02-21 17:09:51 -0800 |
| commit | bf4afc53b77aeaa48b5409da5c8da6bb4eff7f43 (patch) | |
| tree | 01fdd9d27f1b272bef0127966e08eac44d134d0a /fs/btrfs/tests | |
| parent | e19e1b480ac73c3e62ffebbca1174f0f511f43e7 (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/btrfs/tests')
| -rw-r--r-- | fs/btrfs/tests/btrfs-tests.c | 10 | ||||
| -rw-r--r-- | fs/btrfs/tests/delayed-refs-tests.c | 2 |
2 files changed, 6 insertions, 6 deletions
diff --git a/fs/btrfs/tests/btrfs-tests.c b/fs/btrfs/tests/btrfs-tests.c index c5b1bc0f7f91..fa177070d2d0 100644 --- a/fs/btrfs/tests/btrfs-tests.c +++ b/fs/btrfs/tests/btrfs-tests.c @@ -98,7 +98,7 @@ struct btrfs_device *btrfs_alloc_dummy_device(struct btrfs_fs_info *fs_info) { struct btrfs_device *dev; - dev = kzalloc_obj(*dev, GFP_KERNEL); + dev = kzalloc_obj(*dev); if (!dev) return ERR_PTR(-ENOMEM); @@ -122,14 +122,14 @@ struct btrfs_fs_info *btrfs_alloc_dummy_fs_info(u32 nodesize, u32 sectorsize) if (!fs_info) return fs_info; - fs_info->fs_devices = kzalloc_obj(struct btrfs_fs_devices, GFP_KERNEL); + fs_info->fs_devices = kzalloc_obj(struct btrfs_fs_devices); if (!fs_info->fs_devices) { kfree(fs_info); return NULL; } INIT_LIST_HEAD(&fs_info->fs_devices->devices); - fs_info->super_copy = kzalloc_obj(struct btrfs_super_block, GFP_KERNEL); + fs_info->super_copy = kzalloc_obj(struct btrfs_super_block); if (!fs_info->super_copy) { kfree(fs_info->fs_devices); kfree(fs_info); @@ -206,10 +206,10 @@ btrfs_alloc_dummy_block_group(struct btrfs_fs_info *fs_info, { struct btrfs_block_group *cache; - cache = kzalloc_obj(*cache, GFP_KERNEL); + cache = kzalloc_obj(*cache); if (!cache) return NULL; - cache->free_space_ctl = kzalloc_obj(*cache->free_space_ctl, GFP_KERNEL); + cache->free_space_ctl = kzalloc_obj(*cache->free_space_ctl); if (!cache->free_space_ctl) { kfree(cache); return NULL; diff --git a/fs/btrfs/tests/delayed-refs-tests.c b/fs/btrfs/tests/delayed-refs-tests.c index fdc183ebc6da..ccab45d849bb 100644 --- a/fs/btrfs/tests/delayed-refs-tests.c +++ b/fs/btrfs/tests/delayed-refs-tests.c @@ -985,7 +985,7 @@ int btrfs_test_delayed_refs(u32 sectorsize, u32 nodesize) test_std_err(TEST_ALLOC_FS_INFO); return -ENOMEM; } - transaction = kmalloc_obj(*transaction, GFP_KERNEL); + transaction = kmalloc_obj(*transaction); if (!transaction) { test_std_err(TEST_ALLOC_TRANSACTION); ret = -ENOMEM; |
