On Wed, Oct 26, 2022 at 01:08:06PM -0700, Darrick J. Wong wrote: > From: Darrick J. Wong <djwong@xxxxxxxxxx> > > Refactor all the open-coded sizeof logic for EFI/EFD log item and log > format structures into common helper functions whose names reflect the > struct names. > > Signed-off-by: Darrick J. Wong <djwong@xxxxxxxxxx> > Reviewed-by: Allison Henderson <allison.henderson@xxxxxxxxxx> > Reviewed-by: Dave Chinner <dchinner@xxxxxxxxxx> > --- .... > @@ -155,13 +144,11 @@ xfs_efi_init( > > { > struct xfs_efi_log_item *efip; > - uint size; > > ASSERT(nextents > 0); > if (nextents > XFS_EFI_MAX_FAST_EXTENTS) { > - size = (uint)(sizeof(struct xfs_efi_log_item) + > - (nextents * sizeof(xfs_extent_t))); > - efip = kmem_zalloc(size, 0); > + efip = kzalloc(xfs_efi_log_item_sizeof(nextents), > + GFP_KERNEL | __GFP_NOFAIL); Yup, those allocations look right now :) Cheers, Dave. -- Dave Chinner david@xxxxxxxxxxxxx