summaryrefslogtreecommitdiff
path: root/fs/bcachefs/subvolume.h
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2023-07-16 15:59:40 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-22 17:10:07 -0400
commit93de9e92c32c73d25bccbd82b1dabff3e3c2b7d2 (patch)
tree2d8652935a426f1a171293f1dd3a5f3c279fb7cb /fs/bcachefs/subvolume.h
parent813e0cecd1473d7328376f9ca56f9239bc5b8146 (diff)
downloadlwn-93de9e92c32c73d25bccbd82b1dabff3e3c2b7d2.tar.gz
lwn-93de9e92c32c73d25bccbd82b1dabff3e3c2b7d2.zip
bcachefs: Inline bch2_snapshot_is_ancestor() fast path
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/subvolume.h')
-rw-r--r--fs/bcachefs/subvolume.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/fs/bcachefs/subvolume.h b/fs/bcachefs/subvolume.h
index 12a08a34e9bb..6905e91a9470 100644
--- a/fs/bcachefs/subvolume.h
+++ b/fs/bcachefs/subvolume.h
@@ -166,7 +166,14 @@ static inline u32 bch2_snapshot_sibling(struct bch_fs *c, u32 id)
return 0;
}
-bool bch2_snapshot_is_ancestor(struct bch_fs *, u32, u32);
+bool __bch2_snapshot_is_ancestor(struct bch_fs *, u32, u32);
+
+static inline bool bch2_snapshot_is_ancestor(struct bch_fs *c, u32 id, u32 ancestor)
+{
+ return id == ancestor
+ ? true
+ : __bch2_snapshot_is_ancestor(c, id, ancestor);
+}
static inline bool bch2_snapshot_has_children(struct bch_fs *c, u32 id)
{