On Fri, May 10, 2019 at 10:34:13AM -0700, Christoph Hellwig wrote: > > @@ -724,8 +723,6 @@ xfs_alloc_ag_vextent( > > args->wasfromfl = 0; > > switch (args->type) { > > case XFS_ALLOCTYPE_THIS_AG: > > - error = xfs_alloc_ag_vextent_size(args); > > - break; > > case XFS_ALLOCTYPE_NEAR_BNO: > > case XFS_ALLOCTYPE_THIS_BNO: > > error = xfs_alloc_ag_vextent_type(args); > > @@ -817,6 +814,8 @@ xfs_alloc_cur_setup( > > > > if (args->agbno != NULLAGBLOCK) > > agbno = args->agbno; > > + if (args->type == XFS_ALLOCTYPE_THIS_AG) > > + acur->cur_len += args->alignment - 1; > > At this point we can just kill that switch, or even better > merge xfs_alloc_ag_vextent_type and xfs_alloc_ag_vextent. Yeah, we can probably replace that switch with a simple assert on the allocation type. WRT to merging the functions, I'm a little concerned about the result being too large. What do you think about folding in _vextent_type() but at the same time factoring out the rmap/counter/resv post alloc bits into an xfs_alloc_ag_vextent_accounting() helper or some such? Brian