xfs_defer_pending_cancel_work(mp, dfp);
 }
 
+static inline void
+xfs_defer_relog_intent(
+       struct xfs_trans                *tp,
+       struct xfs_defer_pending        *dfp)
+{
+       struct xfs_log_item             *lip;
+       const struct xfs_defer_op_type  *ops = defer_op_types[dfp->dfp_type];
+
+       xfs_defer_create_done(tp, dfp);
+
+       lip = ops->relog_intent(tp, dfp->dfp_intent, dfp->dfp_done);
+       if (lip) {
+               xfs_trans_add_item(tp, lip);
+               set_bit(XFS_LI_DIRTY, &lip->li_flags);
+       }
+       dfp->dfp_done = NULL;
+       dfp->dfp_intent = lip;
+}
+
 /*
  * Prevent a log intent item from pinning the tail of the log by logging a
  * done item to release the intent item; and then log a new intent item.
        ASSERT((*tpp)->t_flags & XFS_TRANS_PERM_LOG_RES);
 
        list_for_each_entry(dfp, dfops, dfp_list) {
-               struct xfs_log_item     *lip;
-
                /*
                 * If the log intent item for this deferred op is not a part of
                 * the current log checkpoint, relog the intent item to keep
                trace_xfs_defer_relog_intent((*tpp)->t_mountp, dfp);
                XFS_STATS_INC((*tpp)->t_mountp, defer_relog);
 
-               xfs_defer_create_done(*tpp, dfp);
-               lip = xfs_trans_item_relog(dfp->dfp_intent, dfp->dfp_done,
-                               *tpp);
-               if (lip) {
-                       xfs_trans_add_item(*tpp, lip);
-                       set_bit(XFS_LI_DIRTY, &lip->li_flags);
-               }
-               dfp->dfp_done = NULL;
-               dfp->dfp_intent = lip;
+               xfs_defer_relog_intent(*tpp, dfp);
        }
 
        if ((*tpp)->t_flags & XFS_TRANS_DIRTY)
 
        void (*cancel_item)(struct list_head *item);
        int (*recover_work)(struct xfs_defer_pending *dfp,
                            struct list_head *capture_list);
+       struct xfs_log_item *(*relog_intent)(struct xfs_trans *tp,
+                       struct xfs_log_item *intent,
+                       struct xfs_log_item *done_item);
        unsigned int            max_items;
 };
 
 
 
 /* Re-log an intent item to push the log tail forward. */
 static struct xfs_log_item *
-xfs_attri_item_relog(
+xfs_attr_relog_intent(
+       struct xfs_trans                *tp,
        struct xfs_log_item             *intent,
-       struct xfs_log_item             *done_item,
-       struct xfs_trans                *tp)
+       struct xfs_log_item             *done_item)
 {
        struct xfs_attri_log_item       *old_attrip;
        struct xfs_attri_log_item       *new_attrip;
        .finish_item    = xfs_attr_finish_item,
        .cancel_item    = xfs_attr_cancel_item,
        .recover_work   = xfs_attr_recover_work,
+       .relog_intent   = xfs_attr_relog_intent,
 };
 
 /*
        .iop_unpin      = xfs_attri_item_unpin,
        .iop_release    = xfs_attri_item_release,
        .iop_match      = xfs_attri_item_match,
-       .iop_relog      = xfs_attri_item_relog,
 };
 
 const struct xlog_recover_item_ops xlog_attri_item_ops = {
 
        return error;
 }
 
-const struct xfs_defer_op_type xfs_bmap_update_defer_type = {
-       .max_items      = XFS_BUI_MAX_FAST_EXTENTS,
-       .create_intent  = xfs_bmap_update_create_intent,
-       .abort_intent   = xfs_bmap_update_abort_intent,
-       .create_done    = xfs_bmap_update_create_done,
-       .finish_item    = xfs_bmap_update_finish_item,
-       .cancel_item    = xfs_bmap_update_cancel_item,
-       .recover_work   = xfs_bmap_recover_work,
-};
-
-STATIC bool
-xfs_bui_item_match(
-       struct xfs_log_item     *lip,
-       uint64_t                intent_id)
-{
-       return BUI_ITEM(lip)->bui_format.bui_id == intent_id;
-}
-
 /* Relog an intent item to push the log tail forward. */
 static struct xfs_log_item *
-xfs_bui_item_relog(
+xfs_bmap_relog_intent(
+       struct xfs_trans                *tp,
        struct xfs_log_item             *intent,
-       struct xfs_log_item             *done_item,
-       struct xfs_trans                *tp)
+       struct xfs_log_item             *done_item)
 {
        struct xfs_bui_log_item         *buip;
        struct xfs_map_extent           *map;
        return &buip->bui_item;
 }
 
+const struct xfs_defer_op_type xfs_bmap_update_defer_type = {
+       .max_items      = XFS_BUI_MAX_FAST_EXTENTS,
+       .create_intent  = xfs_bmap_update_create_intent,
+       .abort_intent   = xfs_bmap_update_abort_intent,
+       .create_done    = xfs_bmap_update_create_done,
+       .finish_item    = xfs_bmap_update_finish_item,
+       .cancel_item    = xfs_bmap_update_cancel_item,
+       .recover_work   = xfs_bmap_recover_work,
+       .relog_intent   = xfs_bmap_relog_intent,
+};
+
+STATIC bool
+xfs_bui_item_match(
+       struct xfs_log_item     *lip,
+       uint64_t                intent_id)
+{
+       return BUI_ITEM(lip)->bui_format.bui_id == intent_id;
+}
+
 static const struct xfs_item_ops xfs_bui_item_ops = {
        .flags          = XFS_ITEM_INTENT,
        .iop_size       = xfs_bui_item_size,
        .iop_unpin      = xfs_bui_item_unpin,
        .iop_release    = xfs_bui_item_release,
        .iop_match      = xfs_bui_item_match,
-       .iop_relog      = xfs_bui_item_relog,
 };
 
 static inline void
 
        return error;
 }
 
+/* Relog an intent item to push the log tail forward. */
+static struct xfs_log_item *
+xfs_extent_free_relog_intent(
+       struct xfs_trans                *tp,
+       struct xfs_log_item             *intent,
+       struct xfs_log_item             *done_item)
+{
+       struct xfs_efd_log_item         *efdp = EFD_ITEM(done_item);
+       struct xfs_efi_log_item         *efip;
+       struct xfs_extent               *extp;
+       unsigned int                    count;
+
+       count = EFI_ITEM(intent)->efi_format.efi_nextents;
+       extp = EFI_ITEM(intent)->efi_format.efi_extents;
+
+       efdp->efd_next_extent = count;
+       memcpy(efdp->efd_format.efd_extents, extp, count * sizeof(*extp));
+
+       efip = xfs_efi_init(tp->t_mountp, count);
+       memcpy(efip->efi_format.efi_extents, extp, count * sizeof(*extp));
+       atomic_set(&efip->efi_next_extent, count);
+
+       return &efip->efi_item;
+}
+
 const struct xfs_defer_op_type xfs_extent_free_defer_type = {
        .max_items      = XFS_EFI_MAX_FAST_EXTENTS,
        .create_intent  = xfs_extent_free_create_intent,
        .finish_item    = xfs_extent_free_finish_item,
        .cancel_item    = xfs_extent_free_cancel_item,
        .recover_work   = xfs_extent_free_recover_work,
+       .relog_intent   = xfs_extent_free_relog_intent,
 };
 
 /* sub-type with special handling for AGFL deferred frees */
        .finish_item    = xfs_agfl_free_finish_item,
        .cancel_item    = xfs_extent_free_cancel_item,
        .recover_work   = xfs_extent_free_recover_work,
+       .relog_intent   = xfs_extent_free_relog_intent,
 };
 
 STATIC bool
        return EFI_ITEM(lip)->efi_format.efi_id == intent_id;
 }
 
-/* Relog an intent item to push the log tail forward. */
-static struct xfs_log_item *
-xfs_efi_item_relog(
-       struct xfs_log_item             *intent,
-       struct xfs_log_item             *done_item,
-       struct xfs_trans                *tp)
-{
-       struct xfs_efd_log_item         *efdp = EFD_ITEM(done_item);
-       struct xfs_efi_log_item         *efip;
-       struct xfs_extent               *extp;
-       unsigned int                    count;
-
-       count = EFI_ITEM(intent)->efi_format.efi_nextents;
-       extp = EFI_ITEM(intent)->efi_format.efi_extents;
-
-       efdp->efd_next_extent = count;
-       memcpy(efdp->efd_format.efd_extents, extp, count * sizeof(*extp));
-
-       efip = xfs_efi_init(tp->t_mountp, count);
-       memcpy(efip->efi_format.efi_extents, extp, count * sizeof(*extp));
-       atomic_set(&efip->efi_next_extent, count);
-
-       return &efip->efi_item;
-}
-
 static const struct xfs_item_ops xfs_efi_item_ops = {
        .flags          = XFS_ITEM_INTENT,
        .iop_size       = xfs_efi_item_size,
        .iop_unpin      = xfs_efi_item_unpin,
        .iop_release    = xfs_efi_item_release,
        .iop_match      = xfs_efi_item_match,
-       .iop_relog      = xfs_efi_item_relog,
 };
 
 /*
 
        return error;
 }
 
+/* Relog an intent item to push the log tail forward. */
+static struct xfs_log_item *
+xfs_refcount_relog_intent(
+       struct xfs_trans                *tp,
+       struct xfs_log_item             *intent,
+       struct xfs_log_item             *done_item)
+{
+       struct xfs_cui_log_item         *cuip;
+       struct xfs_phys_extent          *pmap;
+       unsigned int                    count;
+
+       count = CUI_ITEM(intent)->cui_format.cui_nextents;
+       pmap = CUI_ITEM(intent)->cui_format.cui_extents;
+
+       cuip = xfs_cui_init(tp->t_mountp, count);
+       memcpy(cuip->cui_format.cui_extents, pmap, count * sizeof(*pmap));
+       atomic_set(&cuip->cui_next_extent, count);
+
+       return &cuip->cui_item;
+}
+
 const struct xfs_defer_op_type xfs_refcount_update_defer_type = {
        .max_items      = XFS_CUI_MAX_FAST_EXTENTS,
        .create_intent  = xfs_refcount_update_create_intent,
        .finish_cleanup = xfs_refcount_finish_one_cleanup,
        .cancel_item    = xfs_refcount_update_cancel_item,
        .recover_work   = xfs_refcount_recover_work,
+       .relog_intent   = xfs_refcount_relog_intent,
 };
 
 STATIC bool
        return CUI_ITEM(lip)->cui_format.cui_id == intent_id;
 }
 
-/* Relog an intent item to push the log tail forward. */
-static struct xfs_log_item *
-xfs_cui_item_relog(
-       struct xfs_log_item             *intent,
-       struct xfs_log_item             *done_item,
-       struct xfs_trans                *tp)
-{
-       struct xfs_cui_log_item         *cuip;
-       struct xfs_phys_extent          *pmap;
-       unsigned int                    count;
-
-       count = CUI_ITEM(intent)->cui_format.cui_nextents;
-       pmap = CUI_ITEM(intent)->cui_format.cui_extents;
-
-       cuip = xfs_cui_init(tp->t_mountp, count);
-       memcpy(cuip->cui_format.cui_extents, pmap, count * sizeof(*pmap));
-       atomic_set(&cuip->cui_next_extent, count);
-
-       return &cuip->cui_item;
-}
-
 static const struct xfs_item_ops xfs_cui_item_ops = {
        .flags          = XFS_ITEM_INTENT,
        .iop_size       = xfs_cui_item_size,
        .iop_unpin      = xfs_cui_item_unpin,
        .iop_release    = xfs_cui_item_release,
        .iop_match      = xfs_cui_item_match,
-       .iop_relog      = xfs_cui_item_relog,
 };
 
 static inline void
 
        return error;
 }
 
+/* Relog an intent item to push the log tail forward. */
+static struct xfs_log_item *
+xfs_rmap_relog_intent(
+       struct xfs_trans                *tp,
+       struct xfs_log_item             *intent,
+       struct xfs_log_item             *done_item)
+{
+       struct xfs_rui_log_item         *ruip;
+       struct xfs_map_extent           *map;
+       unsigned int                    count;
+
+       count = RUI_ITEM(intent)->rui_format.rui_nextents;
+       map = RUI_ITEM(intent)->rui_format.rui_extents;
+
+       ruip = xfs_rui_init(tp->t_mountp, count);
+       memcpy(ruip->rui_format.rui_extents, map, count * sizeof(*map));
+       atomic_set(&ruip->rui_next_extent, count);
+
+       return &ruip->rui_item;
+}
+
 const struct xfs_defer_op_type xfs_rmap_update_defer_type = {
        .max_items      = XFS_RUI_MAX_FAST_EXTENTS,
        .create_intent  = xfs_rmap_update_create_intent,
        .finish_cleanup = xfs_rmap_finish_one_cleanup,
        .cancel_item    = xfs_rmap_update_cancel_item,
        .recover_work   = xfs_rmap_recover_work,
+       .relog_intent   = xfs_rmap_relog_intent,
 };
 
 STATIC bool
        return RUI_ITEM(lip)->rui_format.rui_id == intent_id;
 }
 
-/* Relog an intent item to push the log tail forward. */
-static struct xfs_log_item *
-xfs_rui_item_relog(
-       struct xfs_log_item             *intent,
-       struct xfs_log_item             *done_item,
-       struct xfs_trans                *tp)
-{
-       struct xfs_rui_log_item         *ruip;
-       struct xfs_map_extent           *map;
-       unsigned int                    count;
-
-       count = RUI_ITEM(intent)->rui_format.rui_nextents;
-       map = RUI_ITEM(intent)->rui_format.rui_extents;
-
-       ruip = xfs_rui_init(tp->t_mountp, count);
-       memcpy(ruip->rui_format.rui_extents, map, count * sizeof(*map));
-       atomic_set(&ruip->rui_next_extent, count);
-
-       return &ruip->rui_item;
-}
-
 static const struct xfs_item_ops xfs_rui_item_ops = {
        .flags          = XFS_ITEM_INTENT,
        .iop_size       = xfs_rui_item_size,
        .iop_unpin      = xfs_rui_item_unpin,
        .iop_release    = xfs_rui_item_release,
        .iop_match      = xfs_rui_item_match,
-       .iop_relog      = xfs_rui_item_relog,
 };
 
 static inline void
 
        uint (*iop_push)(struct xfs_log_item *, struct list_head *);
        void (*iop_release)(struct xfs_log_item *);
        bool (*iop_match)(struct xfs_log_item *item, uint64_t id);
-       struct xfs_log_item *(*iop_relog)(struct xfs_log_item *intent,
-                       struct xfs_log_item *done_item,
-                       struct xfs_trans *tp);
        struct xfs_log_item *(*iop_intent)(struct xfs_log_item *intent_done);
 };
 
 
 extern struct kmem_cache       *xfs_trans_cache;
 
-static inline struct xfs_log_item *
-xfs_trans_item_relog(
-       struct xfs_log_item     *lip,
-       struct xfs_log_item     *done_lip,
-       struct xfs_trans        *tp)
-{
-       return lip->li_ops->iop_relog(lip, done_lip, tp);
-}
-
 struct xfs_dquot;
 
 int xfs_trans_alloc_inode(struct xfs_inode *ip, struct xfs_trans_res *resv,