diff options
Diffstat (limited to 'volumes.h')
-rw-r--r-- | volumes.h | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -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, |