On 10/26/18 2:24 PM, Christoph Hellwig wrote: > On Fri, Oct 26, 2018 at 02:11:47PM -0500, Eric Sandeen wrote: >> static const struct >> xfs_defer_op_type *defer_op_types[XFS_DEFER_OPS_TYPE_MAX] = { >> xfs_bmap_update_defer_type, >> xfs_refcount_update_defer_type, >> xfs_rmap_update_defer_type, >> xfs_extent_free_defer_type, >> xfs_agfl_free_defer_type, >> }; > > I think this should be: > > 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, > }; > > somefunc() > { > BUILD_BUG_ON(ARRAY_SIZE(defer_op_types) != XFS_DEFER_OPS_TYPE_MAX); > } > Uh, yeah, that's what I was trying but pitifully failing to come up with, thanks. :) -Eric