summaryrefslogtreecommitdiff
path: root/fs/btrfs/delayed-ref.h
diff options
context:
space:
mode:
authorJosef Bacik <josef@toxicpanda.com>2024-04-13 00:11:22 -0400
committerDavid Sterba <dsterba@suse.com>2024-05-07 21:31:05 +0200
commit99f2be15229ae269afa9af0eeaca2deefa87fdb3 (patch)
tree408e19a54ae367d91c52a84dcfffa347c31bca98 /fs/btrfs/delayed-ref.h
parent7f6af7c434d9db0f937774e9f0e31bf5fc73a86e (diff)
btrfs: replace btrfs_delayed_*_ref with btrfs_*_ref
Now that these two structs are the same, move the btrfs_data_ref and btrfs_tree_ref up and use these in the btrfs_delayed_ref_node. Then remove the btrfs_delayed_*_ref structs. 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.h55
1 files changed, 23 insertions, 32 deletions
diff --git a/fs/btrfs/delayed-ref.h b/fs/btrfs/delayed-ref.h
index 09f2c4cfea7f..04b180ebe1fe 100644
--- a/fs/btrfs/delayed-ref.h
+++ b/fs/btrfs/delayed-ref.h
@@ -30,15 +30,32 @@ enum btrfs_delayed_ref_action {
BTRFS_UPDATE_DELAYED_HEAD,
} __packed;
-struct btrfs_delayed_tree_ref {
- int level;
-};
+struct btrfs_data_ref {
+ /* For EXTENT_DATA_REF */
-struct btrfs_delayed_data_ref {
+ /* Inode which refers to this data extent */
u64 objectid;
+
+ /*
+ * file_offset - extent_offset
+ *
+ * file_offset is the key.offset of the EXTENT_DATA key.
+ * extent_offset is btrfs_file_extent_offset() of the EXTENT_DATA data.
+ */
u64 offset;
};
+struct btrfs_tree_ref {
+ /*
+ * Level of this tree block.
+ *
+ * Shared for skinny (TREE_BLOCK_REF) and normal tree ref.
+ */
+ int level;
+
+ /* For non-skinny metadata, no special member needed */
+};
+
struct btrfs_delayed_ref_node {
struct rb_node ref_node;
/*
@@ -84,8 +101,8 @@ struct btrfs_delayed_ref_node {
unsigned int type:8;
union {
- struct btrfs_delayed_tree_ref tree_ref;
- struct btrfs_delayed_data_ref data_ref;
+ struct btrfs_tree_ref tree_ref;
+ struct btrfs_data_ref data_ref;
};
};
@@ -222,32 +239,6 @@ enum btrfs_ref_type {
BTRFS_REF_LAST,
} __packed;
-struct btrfs_data_ref {
- /* For EXTENT_DATA_REF */
-
- /* Inode which refers to this data extent */
- u64 objectid;
-
- /*
- * file_offset - extent_offset
- *
- * file_offset is the key.offset of the EXTENT_DATA key.
- * extent_offset is btrfs_file_extent_offset() of the EXTENT_DATA data.
- */
- u64 offset;
-};
-
-struct btrfs_tree_ref {
- /*
- * Level of this tree block
- *
- * Shared for skinny (TREE_BLOCK_REF) and normal tree ref.
- */
- int level;
-
- /* For non-skinny metadata, no special member needed */
-};
-
struct btrfs_ref {
enum btrfs_ref_type type;
enum btrfs_delayed_ref_action action;