powerpc/64s: Fix KVM system reset handling when CONFIG_PPC_PSERIES=y
[linux-2.6-microblaze.git] / fs / xfs / xfs_extfree_item.c
index 17d36fe..6c11bfc 100644 (file)
@@ -627,7 +627,7 @@ xfs_efi_item_recover(
 
        }
 
-       return xfs_defer_ops_capture_and_commit(tp, capture_list);
+       return xfs_defer_ops_capture_and_commit(tp, NULL, capture_list);
 
 abort_error:
        xfs_trans_cancel(tp);
@@ -642,6 +642,34 @@ xfs_efi_item_match(
        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_trans                *tp)
+{
+       struct xfs_efd_log_item         *efdp;
+       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;
+
+       tp->t_flags |= XFS_TRANS_DIRTY;
+       efdp = xfs_trans_get_efd(tp, EFI_ITEM(intent), count);
+       efdp->efd_next_extent = count;
+       memcpy(efdp->efd_format.efd_extents, extp, count * sizeof(*extp));
+       set_bit(XFS_LI_DIRTY, &efdp->efd_item.li_flags);
+
+       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);
+       xfs_trans_add_item(tp, &efip->efi_item);
+       set_bit(XFS_LI_DIRTY, &efip->efi_item.li_flags);
+       return &efip->efi_item;
+}
+
 static const struct xfs_item_ops xfs_efi_item_ops = {
        .iop_size       = xfs_efi_item_size,
        .iop_format     = xfs_efi_item_format,
@@ -649,6 +677,7 @@ static const struct xfs_item_ops xfs_efi_item_ops = {
        .iop_release    = xfs_efi_item_release,
        .iop_recover    = xfs_efi_item_recover,
        .iop_match      = xfs_efi_item_match,
+       .iop_relog      = xfs_efi_item_relog,
 };
 
 /*