summaryrefslogtreecommitdiff
path: root/volumes.h
diff options
context:
space:
mode:
Diffstat (limited to 'volumes.h')
-rw-r--r--volumes.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/volumes.h b/volumes.h
index 99a3fa11..71d5d663 100644
--- a/volumes.h
+++ b/volumes.h
@@ -148,6 +148,16 @@ struct map_lookup {
#define BTRFS_RAID5_P_STRIPE ((u64)-2)
#define BTRFS_RAID6_Q_STRIPE ((u64)-1)
+/*
+ * Check if the given range cross stripes.
+ * To ensure kernel scrub won't causing bug on with METADATA in mixed
+ * block group
+ */
+static inline int check_crossing_stripes(u64 start, u64 len)
+{
+ return (start / BTRFS_STRIPE_LEN) !=
+ ((start + len) / BTRFS_STRIPE_LEN);
+}
int __btrfs_map_block(struct btrfs_mapping_tree *map_tree, int rw,
u64 logical, u64 *length, u64 *type,