summaryrefslogtreecommitdiff
path: root/fs/bcachefs/subvolume_types.h
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2023-06-26 01:04:46 +0300
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-23 00:10:06 +0300
commitf26c67f4a7c4951a312547790b11066bc510822e (patch)
treea5f23a05f9a59dce45ffd1e9e354f73bd7279a2d /fs/bcachefs/subvolume_types.h
parent065bd3356ce490ae9454d8b3c98ff298e13d09ac (diff)
downloadlinux-f26c67f4a7c4951a312547790b11066bc510822e.tar.xz
bcachefs: Snapshot depth, skiplist fields
This extents KEY_TYPE_snapshot to include some new fields: - depth, to indicate depth of this particular node from the root - skip[3], skiplist entries for quickly walking back up to the root These are to improve bch2_snapshot_is_ancestor(), making it O(ln(n)) instead of O(n) in the snapshot tree depth. Skiplist nodes are picked at random from the set of ancestor nodes, not some fixed fraction. This introduces bcachefs_metadata_version 1.1, snapshot_skiplists. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/subvolume_types.h')
-rw-r--r--fs/bcachefs/subvolume_types.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/bcachefs/subvolume_types.h b/fs/bcachefs/subvolume_types.h
index c6c1cbad9781..750d975ac468 100644
--- a/fs/bcachefs/subvolume_types.h
+++ b/fs/bcachefs/subvolume_types.h
@@ -8,6 +8,8 @@ typedef DARRAY(u32) snapshot_id_list;
struct snapshot_t {
u32 parent;
+ u32 skip[3];
+ u32 depth;
u32 children[2];
u32 subvol; /* Nonzero only if a subvolume points to this node: */
u32 tree;