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/orangefs | |
| parent | e19e1b480ac73c3e62ffebbca1174f0f511f43e7 (diff) | |
| download | lwn-bf4afc53b77aeaa48b5409da5c8da6bb4eff7f43.tar.gz lwn-bf4afc53b77aeaa48b5409da5c8da6bb4eff7f43.zip | |
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/orangefs')
| -rw-r--r-- | fs/orangefs/dir.c | 2 | ||||
| -rw-r--r-- | fs/orangefs/inode.c | 10 | ||||
| -rw-r--r-- | fs/orangefs/orangefs-bufmap.c | 4 | ||||
| -rw-r--r-- | fs/orangefs/orangefs-debugfs.c | 2 | ||||
| -rw-r--r-- | fs/orangefs/orangefs-mod.c | 2 | ||||
| -rw-r--r-- | fs/orangefs/orangefs-sysfs.c | 14 | ||||
| -rw-r--r-- | fs/orangefs/super.c | 2 | ||||
| -rw-r--r-- | fs/orangefs/xattr.c | 4 |
8 files changed, 20 insertions, 20 deletions
diff --git a/fs/orangefs/dir.c b/fs/orangefs/dir.c index 84db9f0db9df..6e2ebc8b9867 100644 --- a/fs/orangefs/dir.c +++ b/fs/orangefs/dir.c @@ -363,7 +363,7 @@ static int orangefs_dir_iterate(struct file *file, static int orangefs_dir_open(struct inode *inode, struct file *file) { struct orangefs_dir *od; - file->private_data = kmalloc_obj(struct orangefs_dir, GFP_KERNEL); + file->private_data = kmalloc_obj(struct orangefs_dir); if (!file->private_data) return -ENOMEM; od = file->private_data; diff --git a/fs/orangefs/inode.c b/fs/orangefs/inode.c index 50836be41cd2..2d4710d0e05e 100644 --- a/fs/orangefs/inode.c +++ b/fs/orangefs/inode.c @@ -184,16 +184,16 @@ static int orangefs_writepages(struct address_space *mapping, int error; struct folio *folio = NULL; - ow = kzalloc_obj(struct orangefs_writepages, GFP_KERNEL); + ow = kzalloc_obj(struct orangefs_writepages); if (!ow) return -ENOMEM; ow->maxpages = orangefs_bufmap_size_query()/PAGE_SIZE; - ow->folios = kzalloc_objs(struct folio *, ow->maxpages, GFP_KERNEL); + ow->folios = kzalloc_objs(struct folio *, ow->maxpages); if (!ow->folios) { kfree(ow); return -ENOMEM; } - ow->bv = kzalloc_objs(struct bio_vec, ow->maxpages, GFP_KERNEL); + ow->bv = kzalloc_objs(struct bio_vec, ow->maxpages); if (!ow->bv) { kfree(ow->folios); kfree(ow); @@ -328,7 +328,7 @@ static int orangefs_write_begin(const struct kiocb *iocb, } } - wr = kmalloc_obj(*wr, GFP_KERNEL); + wr = kmalloc_obj(*wr); if (!wr) return -ENOMEM; @@ -644,7 +644,7 @@ vm_fault_t orangefs_page_mkwrite(struct vm_fault *vmf) } } } - wr = kmalloc_obj(*wr, GFP_KERNEL); + wr = kmalloc_obj(*wr); if (!wr) { ret = VM_FAULT_LOCKED|VM_FAULT_RETRY; goto out; diff --git a/fs/orangefs/orangefs-bufmap.c b/fs/orangefs/orangefs-bufmap.c index bad105dd10fa..c54266c75eed 100644 --- a/fs/orangefs/orangefs-bufmap.c +++ b/fs/orangefs/orangefs-bufmap.c @@ -205,7 +205,7 @@ orangefs_bufmap_alloc(struct ORANGEFS_dev_map_desc *user_desc) { struct orangefs_bufmap *bufmap; - bufmap = kzalloc_obj(*bufmap, GFP_KERNEL); + bufmap = kzalloc_obj(*bufmap); if (!bufmap) goto out; @@ -228,7 +228,7 @@ orangefs_bufmap_alloc(struct ORANGEFS_dev_map_desc *user_desc) /* allocate storage to track our page mappings */ bufmap->page_array = - kzalloc_objs(struct page *, bufmap->page_count, GFP_KERNEL); + kzalloc_objs(struct page *, bufmap->page_count); if (!bufmap->page_array) goto out_free_desc_array; diff --git a/fs/orangefs/orangefs-debugfs.c b/fs/orangefs/orangefs-debugfs.c index 229981c310bd..e82b934ed074 100644 --- a/fs/orangefs/orangefs-debugfs.c +++ b/fs/orangefs/orangefs-debugfs.c @@ -560,7 +560,7 @@ static int orangefs_prepare_cdm_array(char *debug_array_string) goto out; } - cdm_array = kzalloc_objs(*cdm_array, cdm_element_count, GFP_KERNEL); + cdm_array = kzalloc_objs(*cdm_array, cdm_element_count); if (!cdm_array) { rc = -ENOMEM; goto out; diff --git a/fs/orangefs/orangefs-mod.c b/fs/orangefs/orangefs-mod.c index 30bc3c17daa4..f591f09531da 100644 --- a/fs/orangefs/orangefs-mod.c +++ b/fs/orangefs/orangefs-mod.c @@ -99,7 +99,7 @@ static int __init orangefs_init(void) goto cleanup_op; orangefs_htable_ops_in_progress = - kzalloc_objs(struct list_head, hash_table_size, GFP_KERNEL); + kzalloc_objs(struct list_head, hash_table_size); if (!orangefs_htable_ops_in_progress) { ret = -ENOMEM; goto cleanup_inode; diff --git a/fs/orangefs/orangefs-sysfs.c b/fs/orangefs/orangefs-sysfs.c index 8ea25b71b1fb..a02bfc7b3542 100644 --- a/fs/orangefs/orangefs-sysfs.c +++ b/fs/orangefs/orangefs-sysfs.c @@ -1170,7 +1170,7 @@ int orangefs_sysfs_init(void) gossip_debug(GOSSIP_SYSFS_DEBUG, "orangefs_sysfs_init: start\n"); /* create /sys/fs/orangefs. */ - orangefs_obj = kzalloc_obj(*orangefs_obj, GFP_KERNEL); + orangefs_obj = kzalloc_obj(*orangefs_obj); if (!orangefs_obj) goto out; @@ -1185,7 +1185,7 @@ int orangefs_sysfs_init(void) kobject_uevent(orangefs_obj, KOBJ_ADD); /* create /sys/fs/orangefs/acache. */ - acache_orangefs_obj = kzalloc_obj(*acache_orangefs_obj, GFP_KERNEL); + acache_orangefs_obj = kzalloc_obj(*acache_orangefs_obj); if (!acache_orangefs_obj) { rc = -EINVAL; goto ofs_obj_bail; @@ -1202,7 +1202,7 @@ int orangefs_sysfs_init(void) kobject_uevent(acache_orangefs_obj, KOBJ_ADD); /* create /sys/fs/orangefs/capcache. */ - capcache_orangefs_obj = kzalloc_obj(*capcache_orangefs_obj, GFP_KERNEL); + capcache_orangefs_obj = kzalloc_obj(*capcache_orangefs_obj); if (!capcache_orangefs_obj) { rc = -EINVAL; goto acache_obj_bail; @@ -1218,7 +1218,7 @@ int orangefs_sysfs_init(void) kobject_uevent(capcache_orangefs_obj, KOBJ_ADD); /* create /sys/fs/orangefs/ccache. */ - ccache_orangefs_obj = kzalloc_obj(*ccache_orangefs_obj, GFP_KERNEL); + ccache_orangefs_obj = kzalloc_obj(*ccache_orangefs_obj); if (!ccache_orangefs_obj) { rc = -EINVAL; goto capcache_obj_bail; @@ -1234,7 +1234,7 @@ int orangefs_sysfs_init(void) kobject_uevent(ccache_orangefs_obj, KOBJ_ADD); /* create /sys/fs/orangefs/ncache. */ - ncache_orangefs_obj = kzalloc_obj(*ncache_orangefs_obj, GFP_KERNEL); + ncache_orangefs_obj = kzalloc_obj(*ncache_orangefs_obj); if (!ncache_orangefs_obj) { rc = -EINVAL; goto ccache_obj_bail; @@ -1251,7 +1251,7 @@ int orangefs_sysfs_init(void) kobject_uevent(ncache_orangefs_obj, KOBJ_ADD); /* create /sys/fs/orangefs/perf_counters. */ - pc_orangefs_obj = kzalloc_obj(*pc_orangefs_obj, GFP_KERNEL); + pc_orangefs_obj = kzalloc_obj(*pc_orangefs_obj); if (!pc_orangefs_obj) { rc = -EINVAL; goto ncache_obj_bail; @@ -1268,7 +1268,7 @@ int orangefs_sysfs_init(void) kobject_uevent(pc_orangefs_obj, KOBJ_ADD); /* create /sys/fs/orangefs/stats. */ - stats_orangefs_obj = kzalloc_obj(*stats_orangefs_obj, GFP_KERNEL); + stats_orangefs_obj = kzalloc_obj(*stats_orangefs_obj); if (!stats_orangefs_obj) { rc = -EINVAL; goto pc_obj_bail; diff --git a/fs/orangefs/super.c b/fs/orangefs/super.c index 3030509ddeaf..4ec7329b41f6 100644 --- a/fs/orangefs/super.c +++ b/fs/orangefs/super.c @@ -578,7 +578,7 @@ int orangefs_init_fs_context(struct fs_context *fc) { struct orangefs_sb_info_s *osi; - osi = kzalloc_obj(struct orangefs_sb_info_s, GFP_KERNEL); + osi = kzalloc_obj(struct orangefs_sb_info_s); if (!osi) return -ENOMEM; diff --git a/fs/orangefs/xattr.c b/fs/orangefs/xattr.c index 44712bcdcef7..1b372189cd10 100644 --- a/fs/orangefs/xattr.c +++ b/fs/orangefs/xattr.c @@ -171,7 +171,7 @@ ssize_t orangefs_inode_getxattr(struct inode *inode, const char *name, " does not exist!\n", get_khandle_from_ino(inode), (char *)new_op->upcall.req.getxattr.key); - cx = kmalloc_obj(*cx, GFP_KERNEL); + cx = kmalloc_obj(*cx); if (cx) { strscpy(cx->key, name); cx->length = -1; @@ -225,7 +225,7 @@ ssize_t orangefs_inode_getxattr(struct inode *inode, const char *name, cx->length = length; cx->timeout = jiffies + HZ; } else { - cx = kmalloc_obj(*cx, GFP_KERNEL); + cx = kmalloc_obj(*cx); if (cx) { strscpy(cx->key, name); memcpy(cx->val, buffer, length); |
