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/ocfs2 | |
| 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/ocfs2')
| -rw-r--r-- | fs/ocfs2/alloc.c | 2 | ||||
| -rw-r--r-- | fs/ocfs2/cluster/heartbeat.c | 4 | ||||
| -rw-r--r-- | fs/ocfs2/cluster/netdebug.c | 2 | ||||
| -rw-r--r-- | fs/ocfs2/cluster/nodemanager.c | 6 | ||||
| -rw-r--r-- | fs/ocfs2/dlm/dlmdomain.c | 8 | ||||
| -rw-r--r-- | fs/ocfs2/dlmglue.c | 2 | ||||
| -rw-r--r-- | fs/ocfs2/file.c | 2 | ||||
| -rw-r--r-- | fs/ocfs2/ioctl.c | 4 | ||||
| -rw-r--r-- | fs/ocfs2/journal.c | 2 | ||||
| -rw-r--r-- | fs/ocfs2/localalloc.c | 2 | ||||
| -rw-r--r-- | fs/ocfs2/namei.c | 2 | ||||
| -rw-r--r-- | fs/ocfs2/stack_o2cb.c | 2 | ||||
| -rw-r--r-- | fs/ocfs2/stack_user.c | 4 | ||||
| -rw-r--r-- | fs/ocfs2/stackglue.c | 2 | ||||
| -rw-r--r-- | fs/ocfs2/suballoc.c | 6 | ||||
| -rw-r--r-- | fs/ocfs2/super.c | 4 |
16 files changed, 27 insertions, 27 deletions
diff --git a/fs/ocfs2/alloc.c b/fs/ocfs2/alloc.c index ce8ce1470981..344fd4d95fbc 100644 --- a/fs/ocfs2/alloc.c +++ b/fs/ocfs2/alloc.c @@ -1202,7 +1202,7 @@ static int ocfs2_add_branch(handle_t *handle, } /* allocate the number of new eb blocks we need */ - new_eb_bhs = kzalloc_objs(struct buffer_head *, new_blocks, GFP_KERNEL); + new_eb_bhs = kzalloc_objs(struct buffer_head *, new_blocks); if (!new_eb_bhs) { status = -ENOMEM; mlog_errno(status); diff --git a/fs/ocfs2/cluster/heartbeat.c b/fs/ocfs2/cluster/heartbeat.c index 91fb76a43900..ace7debb2f0d 100644 --- a/fs/ocfs2/cluster/heartbeat.c +++ b/fs/ocfs2/cluster/heartbeat.c @@ -2001,7 +2001,7 @@ static struct config_item *o2hb_heartbeat_group_make_item(struct config_group *g struct o2hb_region *reg = NULL; int ret; - reg = kzalloc_obj(struct o2hb_region, GFP_KERNEL); + reg = kzalloc_obj(struct o2hb_region); if (reg == NULL) return ERR_PTR(-ENOMEM); @@ -2211,7 +2211,7 @@ struct config_group *o2hb_alloc_hb_set(void) struct o2hb_heartbeat_group *hs = NULL; struct config_group *ret = NULL; - hs = kzalloc_obj(struct o2hb_heartbeat_group, GFP_KERNEL); + hs = kzalloc_obj(struct o2hb_heartbeat_group); if (hs == NULL) goto out; diff --git a/fs/ocfs2/cluster/netdebug.c b/fs/ocfs2/cluster/netdebug.c index 2cb3162aeb89..f7ab66e70799 100644 --- a/fs/ocfs2/cluster/netdebug.c +++ b/fs/ocfs2/cluster/netdebug.c @@ -380,7 +380,7 @@ static int sc_common_open(struct file *file, int ctxt) struct o2net_sock_debug *sd; struct o2net_sock_container *dummy_sc; - dummy_sc = kzalloc_obj(*dummy_sc, GFP_KERNEL); + dummy_sc = kzalloc_obj(*dummy_sc); if (!dummy_sc) return -ENOMEM; diff --git a/fs/ocfs2/cluster/nodemanager.c b/fs/ocfs2/cluster/nodemanager.c index 6fb8bc38c0f7..402563154550 100644 --- a/fs/ocfs2/cluster/nodemanager.c +++ b/fs/ocfs2/cluster/nodemanager.c @@ -587,7 +587,7 @@ static struct config_item *o2nm_node_group_make_item(struct config_group *group, if (strlen(name) > O2NM_MAX_NAME_LEN) return ERR_PTR(-ENAMETOOLONG); - node = kzalloc_obj(struct o2nm_node, GFP_KERNEL); + node = kzalloc_obj(struct o2nm_node); if (node == NULL) return ERR_PTR(-ENOMEM); @@ -695,8 +695,8 @@ static struct config_group *o2nm_cluster_group_make_group(struct config_group *g if (o2nm_single_cluster) return ERR_PTR(-ENOSPC); - cluster = kzalloc_obj(struct o2nm_cluster, GFP_KERNEL); - ns = kzalloc_obj(struct o2nm_node_group, GFP_KERNEL); + cluster = kzalloc_obj(struct o2nm_cluster); + ns = kzalloc_obj(struct o2nm_node_group); o2hb_group = o2hb_alloc_hb_set(); if (cluster == NULL || ns == NULL || o2hb_group == NULL) goto out; diff --git a/fs/ocfs2/dlm/dlmdomain.c b/fs/ocfs2/dlm/dlmdomain.c index ff4868619d35..70ca79e4bdc3 100644 --- a/fs/ocfs2/dlm/dlmdomain.c +++ b/fs/ocfs2/dlm/dlmdomain.c @@ -1048,7 +1048,7 @@ static int dlm_send_regions(struct dlm_ctxt *dlm, unsigned long *node_map) if (find_first_bit(node_map, O2NM_MAX_NODES) >= O2NM_MAX_NODES) goto bail; - qr = kzalloc_obj(struct dlm_query_region, GFP_KERNEL); + qr = kzalloc_obj(struct dlm_query_region); if (!qr) { ret = -ENOMEM; mlog_errno(ret); @@ -1220,7 +1220,7 @@ static int dlm_send_nodeinfo(struct dlm_ctxt *dlm, unsigned long *node_map) if (find_first_bit(node_map, O2NM_MAX_NODES) >= O2NM_MAX_NODES) goto bail; - qn = kzalloc_obj(struct dlm_query_nodeinfo, GFP_KERNEL); + qn = kzalloc_obj(struct dlm_query_nodeinfo); if (!qn) { ret = -ENOMEM; mlog_errno(ret); @@ -1592,7 +1592,7 @@ static int dlm_try_to_join_domain(struct dlm_ctxt *dlm) mlog(0, "%p", dlm); - ctxt = kzalloc_obj(*ctxt, GFP_KERNEL); + ctxt = kzalloc_obj(*ctxt); if (!ctxt) { status = -ENOMEM; mlog_errno(status); @@ -1946,7 +1946,7 @@ static struct dlm_ctxt *dlm_alloc_ctxt(const char *domain, int ret; struct dlm_ctxt *dlm = NULL; - dlm = kzalloc_obj(*dlm, GFP_KERNEL); + dlm = kzalloc_obj(*dlm); if (!dlm) { ret = -ENOMEM; mlog_errno(ret); diff --git a/fs/ocfs2/dlmglue.c b/fs/ocfs2/dlmglue.c index 627d488b0148..bd2ddb7d841d 100644 --- a/fs/ocfs2/dlmglue.c +++ b/fs/ocfs2/dlmglue.c @@ -3030,7 +3030,7 @@ struct ocfs2_dlm_debug *ocfs2_new_dlm_debug(void) { struct ocfs2_dlm_debug *dlm_debug; - dlm_debug = kmalloc_obj(struct ocfs2_dlm_debug, GFP_KERNEL); + dlm_debug = kmalloc_obj(struct ocfs2_dlm_debug); if (!dlm_debug) { mlog_errno(-ENOMEM); goto out; diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c index 70879058b0c9..7df9921c1a38 100644 --- a/fs/ocfs2/file.c +++ b/fs/ocfs2/file.c @@ -54,7 +54,7 @@ static int ocfs2_init_file_private(struct inode *inode, struct file *file) { struct ocfs2_file_private *fp; - fp = kzalloc_obj(struct ocfs2_file_private, GFP_KERNEL); + fp = kzalloc_obj(struct ocfs2_file_private); if (!fp) return -ENOMEM; diff --git a/fs/ocfs2/ioctl.c b/fs/ocfs2/ioctl.c index 872b826979ec..bfed0fb35f9b 100644 --- a/fs/ocfs2/ioctl.c +++ b/fs/ocfs2/ioctl.c @@ -334,7 +334,7 @@ static int ocfs2_info_handle_freeinode(struct inode *inode, struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); struct inode *inode_alloc = NULL; - oifi = kzalloc_obj(struct ocfs2_info_freeinode, GFP_KERNEL); + oifi = kzalloc_obj(struct ocfs2_info_freeinode); if (!oifi) { status = -ENOMEM; mlog_errno(status); @@ -620,7 +620,7 @@ static int ocfs2_info_handle_freefrag(struct inode *inode, struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); struct inode *gb_inode = NULL; - oiff = kzalloc_obj(struct ocfs2_info_freefrag, GFP_KERNEL); + oiff = kzalloc_obj(struct ocfs2_info_freefrag); if (!oiff) { status = -ENOMEM; mlog_errno(status); diff --git a/fs/ocfs2/journal.c b/fs/ocfs2/journal.c index 1b9359304aef..6755f38920bc 100644 --- a/fs/ocfs2/journal.c +++ b/fs/ocfs2/journal.c @@ -876,7 +876,7 @@ int ocfs2_journal_alloc(struct ocfs2_super *osb) int status = 0; struct ocfs2_journal *journal; - journal = kzalloc_obj(struct ocfs2_journal, GFP_KERNEL); + journal = kzalloc_obj(struct ocfs2_journal); if (!journal) { mlog(ML_ERROR, "unable to alloc journal\n"); status = -ENOMEM; diff --git a/fs/ocfs2/localalloc.c b/fs/ocfs2/localalloc.c index 29fa6fb11ea5..82d290cf4432 100644 --- a/fs/ocfs2/localalloc.c +++ b/fs/ocfs2/localalloc.c @@ -1094,7 +1094,7 @@ static int ocfs2_local_alloc_reserve_for_window(struct ocfs2_super *osb, { int status; - *ac = kzalloc_obj(struct ocfs2_alloc_context, GFP_KERNEL); + *ac = kzalloc_obj(struct ocfs2_alloc_context); if (!(*ac)) { status = -ENOMEM; mlog_errno(status); diff --git a/fs/ocfs2/namei.c b/fs/ocfs2/namei.c index 85ad1a9db734..268b79339a51 100644 --- a/fs/ocfs2/namei.c +++ b/fs/ocfs2/namei.c @@ -1736,7 +1736,7 @@ static int ocfs2_create_symlink_data(struct ocfs2_super *osb, goto bail; } - bhs = kzalloc_objs(struct buffer_head *, blocks, GFP_KERNEL); + bhs = kzalloc_objs(struct buffer_head *, blocks); if (!bhs) { status = -ENOMEM; mlog_errno(status); diff --git a/fs/ocfs2/stack_o2cb.c b/fs/ocfs2/stack_o2cb.c index 78a97c37398b..7a55b1a071db 100644 --- a/fs/ocfs2/stack_o2cb.c +++ b/fs/ocfs2/stack_o2cb.c @@ -334,7 +334,7 @@ static int o2cb_cluster_connect(struct ocfs2_cluster_connection *conn) goto out; } - priv = kzalloc_obj(struct o2dlm_private, GFP_KERNEL); + priv = kzalloc_obj(struct o2dlm_private); if (!priv) { rc = -ENOMEM; goto out_free; diff --git a/fs/ocfs2/stack_user.c b/fs/ocfs2/stack_user.c index 11b34407de36..5803f1dee679 100644 --- a/fs/ocfs2/stack_user.c +++ b/fs/ocfs2/stack_user.c @@ -593,7 +593,7 @@ static int ocfs2_control_open(struct inode *inode, struct file *file) { struct ocfs2_control_private *p; - p = kzalloc_obj(struct ocfs2_control_private, GFP_KERNEL); + p = kzalloc_obj(struct ocfs2_control_private); if (!p) return -ENOMEM; p->op_this_node = -1; @@ -967,7 +967,7 @@ static int user_cluster_connect(struct ocfs2_cluster_connection *conn) BUG_ON(conn == NULL); - lc = kzalloc_obj(struct ocfs2_live_connection, GFP_KERNEL); + lc = kzalloc_obj(struct ocfs2_live_connection); if (!lc) return -ENOMEM; diff --git a/fs/ocfs2/stackglue.c b/fs/ocfs2/stackglue.c index 46ff5835da2e..741d6191d871 100644 --- a/fs/ocfs2/stackglue.c +++ b/fs/ocfs2/stackglue.c @@ -328,7 +328,7 @@ int ocfs2_cluster_connect(const char *stack_name, goto out; } - new_conn = kzalloc_obj(struct ocfs2_cluster_connection, GFP_KERNEL); + new_conn = kzalloc_obj(struct ocfs2_cluster_connection); if (!new_conn) { rc = -ENOMEM; goto out; diff --git a/fs/ocfs2/suballoc.c b/fs/ocfs2/suballoc.c index 872c7b303a3c..bb98bd51338e 100644 --- a/fs/ocfs2/suballoc.c +++ b/fs/ocfs2/suballoc.c @@ -1034,7 +1034,7 @@ int ocfs2_reserve_new_metadata_blocks(struct ocfs2_super *osb, int status; int slot = ocfs2_get_meta_steal_slot(osb); - *ac = kzalloc_obj(struct ocfs2_alloc_context, GFP_KERNEL); + *ac = kzalloc_obj(struct ocfs2_alloc_context); if (!(*ac)) { status = -ENOMEM; mlog_errno(status); @@ -1105,7 +1105,7 @@ int ocfs2_reserve_new_inode(struct ocfs2_super *osb, int slot = ocfs2_get_inode_steal_slot(osb); u64 alloc_group; - *ac = kzalloc_obj(struct ocfs2_alloc_context, GFP_KERNEL); + *ac = kzalloc_obj(struct ocfs2_alloc_context); if (!(*ac)) { status = -ENOMEM; mlog_errno(status); @@ -1221,7 +1221,7 @@ static int ocfs2_reserve_clusters_with_limit(struct ocfs2_super *osb, int status, ret = 0; int retried = 0; - *ac = kzalloc_obj(struct ocfs2_alloc_context, GFP_KERNEL); + *ac = kzalloc_obj(struct ocfs2_alloc_context); if (!(*ac)) { status = -ENOMEM; mlog_errno(status); diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c index 9779f524ff1a..d7c58fd7d438 100644 --- a/fs/ocfs2/super.c +++ b/fs/ocfs2/super.c @@ -1200,7 +1200,7 @@ static int ocfs2_init_fs_context(struct fs_context *fc) { struct mount_options *mopt; - mopt = kzalloc_obj(struct mount_options, GFP_KERNEL); + mopt = kzalloc_obj(struct mount_options); if (!mopt) return -EINVAL; @@ -1953,7 +1953,7 @@ static int ocfs2_initialize_super(struct super_block *sb, struct ocfs2_super *osb; u64 total_blocks; - osb = kzalloc_obj(struct ocfs2_super, GFP_KERNEL); + osb = kzalloc_obj(struct ocfs2_super); if (!osb) { status = -ENOMEM; mlog_errno(status); |
