On 10/29/18 1:25 PM, Darrick J. Wong wrote: > From: Darrick J. Wong <darrick.wong@xxxxxxxxxx> > > Recently, we forgot to port a new defer op type to xfsprogs, which > caused us some userspace pain. Reorganize the way we make libxfs > clients supply defer op type information so that all type information > has to be provided at build time instead of risky runtime dynamic > configuration. > > Signed-off-by: Darrick J. Wong <darrick.wong@xxxxxxxxxx> > --- > fs/xfs/libxfs/xfs_defer.c | 17 ++++++++--------- > fs/xfs/libxfs/xfs_defer.h | 6 +++++- > fs/xfs/xfs_super.c | 6 +----- > fs/xfs/xfs_trans.h | 4 ---- > fs/xfs/xfs_trans_bmap.c | 10 ++-------- > fs/xfs/xfs_trans_extfree.c | 13 +++---------- > fs/xfs/xfs_trans_refcount.c | 10 ++-------- > fs/xfs/xfs_trans_rmap.c | 10 ++-------- > 8 files changed, 23 insertions(+), 53 deletions(-) > > > diff --git a/fs/xfs/libxfs/xfs_defer.c b/fs/xfs/libxfs/xfs_defer.c > index e792b167150a..277117a8ad13 100644 > --- a/fs/xfs/libxfs/xfs_defer.c > +++ b/fs/xfs/libxfs/xfs_defer.c > @@ -172,7 +172,13 @@ > * reoccur. > */ > > -static const struct xfs_defer_op_type *defer_op_types[XFS_DEFER_OPS_TYPE_MAX]; > +static const struct xfs_defer_op_type *defer_op_types[] = { > + [XFS_DEFER_OPS_TYPE_BMAP] = &xfs_bmap_update_defer_type, > + [XFS_DEFER_OPS_TYPE_REFCOUNT] = &xfs_refcount_update_defer_type, > + [XFS_DEFER_OPS_TYPE_RMAP] = &xfs_rmap_update_defer_type, > + [XFS_DEFER_OPS_TYPE_FREE] = &xfs_extent_free_defer_type, > + [XFS_DEFER_OPS_TYPE_AGFL_FREE] = &xfs_agfl_free_defer_type, Seeing these together makes me wish we had XFS_DEFER_OPS_TYPE_EXT_FREE or something more clear but that's not for this patch. Reviewed-by: Eric Sandeen <sandeen@xxxxxxxxxx>