Re: [PATCH] xfs: replace kvmalloc_array with kvzalloc_objs
From: Carlos Maiolino
Date: Fri Sep 18 2026 - 01:17:20 EST
On Thu, Sep 17, 2026 at 08:08:35PM +0000, Lalit Shankar Chowdhury wrote:
> Replace kvmalloc_array() with the more concise kvzalloc_objs()
> implementation.
>
> Signed-off-by: Lalit Shankar Chowdhury <lalitshankarch@xxxxxxxxx>
NAK...
This is used to allocate composite objects managed through a
slab cache. This is not for fundamental basic data types....
> ---
> fs/xfs/xfs_zone_alloc.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/fs/xfs/xfs_zone_alloc.c b/fs/xfs/xfs_zone_alloc.c
> index 28c1e48909fa..82615045aa4c 100644
> --- a/fs/xfs/xfs_zone_alloc.c
> +++ b/fs/xfs/xfs_zone_alloc.c
> @@ -1238,8 +1238,7 @@ static unsigned long *
> xfs_alloc_bucket_bitmap(
> struct xfs_mount *mp)
> {
> - return kvmalloc_array(BITS_TO_LONGS(mp->m_sb.sb_rgcount),
> - sizeof(unsigned long), GFP_KERNEL | __GFP_ZERO);
> + return kvzalloc_objs(unsigned long, BITS_TO_LONGS(mp->m_sb.sb_rgcount));
> }
>
> static struct xfs_zone_info *
> --
> 2.53.0
>