summaryrefslogtreecommitdiff
path: root/fs/btrfs/delayed-ref.h
diff options
context:
space:
mode:
authorJosef Bacik <josef@toxicpanda.com>2024-04-12 22:57:13 -0400
committerDavid Sterba <dsterba@suse.com>2024-05-07 21:31:05 +0200
commitcf4f04325b2b27efa5697ba0ea4c1abdee0035b4 (patch)
treeca74b2f1022f2000511fb7411ee93b5319bdb050 /fs/btrfs/delayed-ref.h
parent12390e42b69d7e439cc2a266b6c7b4e1116de7c9 (diff)
downloadlwn-cf4f04325b2b27efa5697ba0ea4c1abdee0035b4.tar.gz
lwn-cf4f04325b2b27efa5697ba0ea4c1abdee0035b4.zip
btrfs: move ->parent and ->ref_root into btrfs_delayed_ref_node
These two members are shared by both the tree refs and data refs, so move them into btrfs_delayed_ref_node proper. This allows us to greatly simplify the comparison code, as the shared refs always only sort on parent, and the non shared refs always sort first on ref_root, and then only data refs sort on their specific fields. Reviewed-by: Filipe Manana <fdmanana@suse.com> Signed-off-by: Josef Bacik <josef@toxicpanda.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/delayed-ref.h')
-rw-r--r--fs/btrfs/delayed-ref.h13
1 files changed, 9 insertions, 4 deletions
diff --git a/fs/btrfs/delayed-ref.h b/fs/btrfs/delayed-ref.h
index 05cf6eb2e604..ec53404cec0c 100644
--- a/fs/btrfs/delayed-ref.h
+++ b/fs/btrfs/delayed-ref.h
@@ -31,14 +31,10 @@ enum btrfs_delayed_ref_action {
} __packed;
struct btrfs_delayed_tree_ref {
- u64 root;
- u64 parent;
int level;
};
struct btrfs_delayed_data_ref {
- u64 root;
- u64 parent;
u64 objectid;
u64 offset;
};
@@ -61,6 +57,15 @@ struct btrfs_delayed_ref_node {
/* seq number to keep track of insertion order */
u64 seq;
+ /* The ref_root for this ref */
+ u64 ref_root;
+
+ /*
+ * The parent for this ref, if this isn't set the ref_root is the
+ * reference owner.
+ */
+ u64 parent;
+
/* ref count on this data structure */
refcount_t refs;