summaryrefslogtreecommitdiff
path: root/fs/xfs/xfs_extent_busy.h
diff options
context:
space:
mode:
authorDave Chinner <dchinner@redhat.com>2023-10-04 01:24:02 +0300
committerDave Chinner <david@fromorbit.com>2023-10-04 01:24:02 +0300
commit428c4435b063bebc7eddcd7d311546d6933efa62 (patch)
treee79082326ff243a890e9d09de170d3bf48542a44 /fs/xfs/xfs_extent_busy.h
parent8a749fd1a8720d4619c91c8b6e7528c0a355c0aa (diff)
downloadlinux-428c4435b063bebc7eddcd7d311546d6933efa62.tar.xz
xfs: move log discard work to xfs_discard.c
Because we are going to use the same list-based discard submission interface for fstrim-based discards, too. Signed-off-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Diffstat (limited to 'fs/xfs/xfs_extent_busy.h')
-rw-r--r--fs/xfs/xfs_extent_busy.h20
1 files changed, 17 insertions, 3 deletions
diff --git a/fs/xfs/xfs_extent_busy.h b/fs/xfs/xfs_extent_busy.h
index c37bf87e6781..71c28d031e3b 100644
--- a/fs/xfs/xfs_extent_busy.h
+++ b/fs/xfs/xfs_extent_busy.h
@@ -16,9 +16,6 @@ struct xfs_alloc_arg;
/*
* Busy block/extent entry. Indexed by a rbtree in perag to mark blocks that
* have been freed but whose transactions aren't committed to disk yet.
- *
- * Note that we use the transaction ID to record the transaction, not the
- * transaction structure itself. See xfs_extent_busy_insert() for details.
*/
struct xfs_extent_busy {
struct rb_node rb_node; /* ag by-bno indexed search tree */
@@ -31,6 +28,23 @@ struct xfs_extent_busy {
#define XFS_EXTENT_BUSY_SKIP_DISCARD 0x02 /* do not discard */
};
+/*
+ * List used to track groups of related busy extents all the way through
+ * to discard completion.
+ */
+struct xfs_busy_extents {
+ struct xfs_mount *mount;
+ struct list_head extent_list;
+ struct work_struct endio_work;
+
+ /*
+ * Owner is the object containing the struct xfs_busy_extents to free
+ * once the busy extents have been processed. If only the
+ * xfs_busy_extents object needs freeing, then point this at itself.
+ */
+ void *owner;
+};
+
void
xfs_extent_busy_insert(struct xfs_trans *tp, struct xfs_perag *pag,
xfs_agblock_t bno, xfs_extlen_t len, unsigned int flags);