mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00
xfs: add log item method to return related intents
To apply a whiteout to an intent item when an intent done item is committed, we need to be able to retrieve the intent item from the the intent done item. Add a log item op method for doing this, and wire all the intent done items up to it. Signed-off-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Allison Henderson <allison.henderson@oracle.com> Reviewed-by: Darrick J. Wong <djwong@kernel.org> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Dave Chinner <david@fromorbit.com>
This commit is contained in:
parent
22b1afc57e
commit
c23ab603e3
5 changed files with 33 additions and 0 deletions
|
@ -203,12 +203,20 @@ xfs_bud_item_release(
|
||||||
kmem_cache_free(xfs_bud_cache, budp);
|
kmem_cache_free(xfs_bud_cache, budp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static struct xfs_log_item *
|
||||||
|
xfs_bud_item_intent(
|
||||||
|
struct xfs_log_item *lip)
|
||||||
|
{
|
||||||
|
return &BUD_ITEM(lip)->bud_buip->bui_item;
|
||||||
|
}
|
||||||
|
|
||||||
static const struct xfs_item_ops xfs_bud_item_ops = {
|
static const struct xfs_item_ops xfs_bud_item_ops = {
|
||||||
.flags = XFS_ITEM_RELEASE_WHEN_COMMITTED |
|
.flags = XFS_ITEM_RELEASE_WHEN_COMMITTED |
|
||||||
XFS_ITEM_INTENT_DONE,
|
XFS_ITEM_INTENT_DONE,
|
||||||
.iop_size = xfs_bud_item_size,
|
.iop_size = xfs_bud_item_size,
|
||||||
.iop_format = xfs_bud_item_format,
|
.iop_format = xfs_bud_item_format,
|
||||||
.iop_release = xfs_bud_item_release,
|
.iop_release = xfs_bud_item_release,
|
||||||
|
.iop_intent = xfs_bud_item_intent,
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct xfs_bud_log_item *
|
static struct xfs_bud_log_item *
|
||||||
|
|
|
@ -306,12 +306,20 @@ xfs_efd_item_release(
|
||||||
xfs_efd_item_free(efdp);
|
xfs_efd_item_free(efdp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static struct xfs_log_item *
|
||||||
|
xfs_efd_item_intent(
|
||||||
|
struct xfs_log_item *lip)
|
||||||
|
{
|
||||||
|
return &EFD_ITEM(lip)->efd_efip->efi_item;
|
||||||
|
}
|
||||||
|
|
||||||
static const struct xfs_item_ops xfs_efd_item_ops = {
|
static const struct xfs_item_ops xfs_efd_item_ops = {
|
||||||
.flags = XFS_ITEM_RELEASE_WHEN_COMMITTED |
|
.flags = XFS_ITEM_RELEASE_WHEN_COMMITTED |
|
||||||
XFS_ITEM_INTENT_DONE,
|
XFS_ITEM_INTENT_DONE,
|
||||||
.iop_size = xfs_efd_item_size,
|
.iop_size = xfs_efd_item_size,
|
||||||
.iop_format = xfs_efd_item_format,
|
.iop_format = xfs_efd_item_format,
|
||||||
.iop_release = xfs_efd_item_release,
|
.iop_release = xfs_efd_item_release,
|
||||||
|
.iop_intent = xfs_efd_item_intent,
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -209,12 +209,20 @@ xfs_cud_item_release(
|
||||||
kmem_cache_free(xfs_cud_cache, cudp);
|
kmem_cache_free(xfs_cud_cache, cudp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static struct xfs_log_item *
|
||||||
|
xfs_cud_item_intent(
|
||||||
|
struct xfs_log_item *lip)
|
||||||
|
{
|
||||||
|
return &CUD_ITEM(lip)->cud_cuip->cui_item;
|
||||||
|
}
|
||||||
|
|
||||||
static const struct xfs_item_ops xfs_cud_item_ops = {
|
static const struct xfs_item_ops xfs_cud_item_ops = {
|
||||||
.flags = XFS_ITEM_RELEASE_WHEN_COMMITTED |
|
.flags = XFS_ITEM_RELEASE_WHEN_COMMITTED |
|
||||||
XFS_ITEM_INTENT_DONE,
|
XFS_ITEM_INTENT_DONE,
|
||||||
.iop_size = xfs_cud_item_size,
|
.iop_size = xfs_cud_item_size,
|
||||||
.iop_format = xfs_cud_item_format,
|
.iop_format = xfs_cud_item_format,
|
||||||
.iop_release = xfs_cud_item_release,
|
.iop_release = xfs_cud_item_release,
|
||||||
|
.iop_intent = xfs_cud_item_intent,
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct xfs_cud_log_item *
|
static struct xfs_cud_log_item *
|
||||||
|
|
|
@ -232,12 +232,20 @@ xfs_rud_item_release(
|
||||||
kmem_cache_free(xfs_rud_cache, rudp);
|
kmem_cache_free(xfs_rud_cache, rudp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static struct xfs_log_item *
|
||||||
|
xfs_rud_item_intent(
|
||||||
|
struct xfs_log_item *lip)
|
||||||
|
{
|
||||||
|
return &RUD_ITEM(lip)->rud_ruip->rui_item;
|
||||||
|
}
|
||||||
|
|
||||||
static const struct xfs_item_ops xfs_rud_item_ops = {
|
static const struct xfs_item_ops xfs_rud_item_ops = {
|
||||||
.flags = XFS_ITEM_RELEASE_WHEN_COMMITTED |
|
.flags = XFS_ITEM_RELEASE_WHEN_COMMITTED |
|
||||||
XFS_ITEM_INTENT_DONE,
|
XFS_ITEM_INTENT_DONE,
|
||||||
.iop_size = xfs_rud_item_size,
|
.iop_size = xfs_rud_item_size,
|
||||||
.iop_format = xfs_rud_item_format,
|
.iop_format = xfs_rud_item_format,
|
||||||
.iop_release = xfs_rud_item_release,
|
.iop_release = xfs_rud_item_release,
|
||||||
|
.iop_intent = xfs_rud_item_intent,
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct xfs_rud_log_item *
|
static struct xfs_rud_log_item *
|
||||||
|
|
|
@ -78,6 +78,7 @@ struct xfs_item_ops {
|
||||||
bool (*iop_match)(struct xfs_log_item *item, uint64_t id);
|
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 *(*iop_relog)(struct xfs_log_item *intent,
|
||||||
struct xfs_trans *tp);
|
struct xfs_trans *tp);
|
||||||
|
struct xfs_log_item *(*iop_intent)(struct xfs_log_item *intent_done);
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Add table
Reference in a new issue