@@ -560,6 +560,7 @@ xfs_bui_item_match(
}
static const struct xfs_item_ops xfs_bui_item_ops = {
+ .flags = XFS_ITEM_LOG_INTENT,
.iop_size = xfs_bui_item_size,
.iop_format = xfs_bui_item_format,
.iop_unpin = xfs_bui_item_unpin,
@@ -650,6 +650,7 @@ xfs_efi_item_match(
}
static const struct xfs_item_ops xfs_efi_item_ops = {
+ .flags = XFS_ITEM_LOG_INTENT,
.iop_size = xfs_efi_item_size,
.iop_format = xfs_efi_item_format,
.iop_unpin = xfs_efi_item_unpin,
@@ -2475,13 +2475,6 @@ xlog_finish_defer_ops(
return xfs_trans_commit(tp);
}
-/* Is this log item a deferred action intent? */
-static inline bool xlog_item_is_intent(struct xfs_log_item *lip)
-{
- return lip->li_ops->iop_recover != NULL &&
- lip->li_ops->iop_match != NULL;
-}
-
/*
* When this is called, all of the log intent items which did not have
* corresponding log done items should be in the AIL. What we do now
@@ -2535,10 +2528,10 @@ xlog_recover_process_intents(
* We're done when we see something other than an intent.
* There should be no intents left in the AIL now.
*/
- if (!xlog_item_is_intent(lip)) {
+ if (!(lip->li_ops->flags & XFS_ITEM_LOG_INTENT)) {
#ifdef DEBUG
for (; lip; lip = xfs_trans_ail_cursor_next(ailp, &cur))
- ASSERT(!xlog_item_is_intent(lip));
+ ASSERT(!(lip->li_ops->flags & XFS_ITEM_LOG_INTENT));
#endif
break;
}
@@ -2595,10 +2588,10 @@ xlog_recover_cancel_intents(
* We're done when we see something other than an intent.
* There should be no intents left in the AIL now.
*/
- if (!xlog_item_is_intent(lip)) {
+ if (!(lip->li_ops->flags & XFS_ITEM_LOG_INTENT)) {
#ifdef DEBUG
for (; lip; lip = xfs_trans_ail_cursor_next(ailp, &cur))
- ASSERT(!xlog_item_is_intent(lip));
+ ASSERT(!(lip->li_ops->flags & XFS_ITEM_LOG_INTENT));
#endif
break;
}
@@ -575,6 +575,7 @@ xfs_cui_item_match(
}
static const struct xfs_item_ops xfs_cui_item_ops = {
+ .flags = XFS_ITEM_LOG_INTENT,
.iop_size = xfs_cui_item_size,
.iop_format = xfs_cui_item_format,
.iop_unpin = xfs_cui_item_unpin,
@@ -591,6 +591,7 @@ xfs_rui_item_match(
}
static const struct xfs_item_ops xfs_rui_item_ops = {
+ .flags = XFS_ITEM_LOG_INTENT,
.iop_size = xfs_rui_item_size,
.iop_format = xfs_rui_item_format,
.iop_unpin = xfs_rui_item_unpin,
@@ -85,7 +85,8 @@ struct xfs_item_ops {
* intents that never need to be written back in place.
*/
#define XFS_ITEM_RELEASE_WHEN_COMMITTED (1 << 0)
-#define XFS_ITEM_LOG_DONE (1 << 1) /* log done item */
+#define XFS_ITEM_LOG_INTENT (1 << 1) /* log intent item */
+#define XFS_ITEM_LOG_DONE (1 << 2) /* log done item */
#define XFS_ITEM_LOG_DONE_FLAG (XFS_ITEM_RELEASE_WHEN_COMMITTED | \
XFS_ITEM_LOG_DONE)