aboutsummaryrefslogtreecommitdiff
path: root/fs/btrfs/compat.h
diff options
context:
space:
mode:
authorQu Wenruo <wqu@suse.com>2020-06-24 18:02:54 +0200
committerTom Rini <trini@konsulko.com>2020-09-07 20:57:27 -0400
commitb1f0067aba5cc51540922e4187d5e8c8f77b1431 (patch)
treed4bef60a6c05a261e47dc38cca7bb6f74790f465 /fs/btrfs/compat.h
parentbe3594254605047d0623f905329d160544ca925c (diff)
downloadu-boot-b1f0067aba5cc51540922e4187d5e8c8f77b1431.zip
u-boot-b1f0067aba5cc51540922e4187d5e8c8f77b1431.tar.gz
u-boot-b1f0067aba5cc51540922e4187d5e8c8f77b1431.tar.bz2
fs: btrfs: Crossport volumes.[ch] from btrfs-progs
This patch crossports volumes.[ch] from btrfs-progs, including: - btrfs_map_block() The core mechanism to map btrfs logical address to physical address. This version includes multi-device support, along with RAID56 support. - btrfs_scan_one_device() This is the function to register one btrfs device to the list. This is the main part of the multi-device btrfs assembling process. Although we're not going to support multiple devices until U-Boot allows us to scan one device without actually opening it. Signed-off-by: Qu Wenruo <wqu@suse.com> Reviewed-by: Marek BehĂșn <marek.behun@nic.cz> [trini: Use %zu in a debug print to avoid warning] Signed-off-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'fs/btrfs/compat.h')
-rw-r--r--fs/btrfs/compat.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/btrfs/compat.h b/fs/btrfs/compat.h
index 12fb9f8..be4f4e7 100644
--- a/fs/btrfs/compat.h
+++ b/fs/btrfs/compat.h
@@ -68,4 +68,9 @@ static inline void uuid_unparse(const u8 *uuid, char *out)
return uuid_bin_to_str((unsigned char *)uuid, out, 0);
}
+static inline int is_power_of_2(unsigned long n)
+{
+ return (n != 0 && ((n & (n - 1)) == 0));
+}
+
#endif