From 979bda6fb5b319799e433c6af18c23bc014b724f Mon Sep 17 00:00:00 2001 From: David Sterba Date: Wed, 22 Sep 2021 20:30:56 +0200 Subject: [PATCH] btrfs-progs: libbtrfs: replace SZ_ constants and drop sizes.h To drop sizes.h from exported headers, replace the few SZ_ constants from the existing exported headers (ctree.h, send.h). It would be nice to use them in the long run but right now it would prevent unexporting the sizes.h file. Signed-off-by: David Sterba --- kernel-shared/ctree.h | 6 ++---- kernel-shared/send.h | 2 +- kernel-shared/volumes.h | 1 + 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/kernel-shared/ctree.h b/kernel-shared/ctree.h index e51cc7a9..da87f10c 100644 --- a/kernel-shared/ctree.h +++ b/kernel-shared/ctree.h @@ -27,7 +27,6 @@ #include "common/extent-cache.h" #include "kernel-shared/extent_io.h" #include "ioctl.h" -#include "kernel-lib/sizes.h" #include "crypto/crc32c.h" #else #include @@ -35,7 +34,6 @@ #include #include #include -#include #include #endif /* BTRFS_FLAT_INCLUDES */ @@ -605,7 +603,7 @@ struct btrfs_extent_item_v0 { #define BTRFS_MAX_EXTENT_ITEM_SIZE(r) \ ((BTRFS_LEAF_DATA_SIZE(r->fs_info) >> 4) - \ sizeof(struct btrfs_item)) -#define BTRFS_MAX_EXTENT_SIZE SZ_128M +#define BTRFS_MAX_EXTENT_SIZE 128UL * 1024 * 1024 #define BTRFS_EXTENT_FLAG_DATA (1ULL << 0) #define BTRFS_EXTENT_FLAG_TREE_BLOCK (1ULL << 1) @@ -962,7 +960,7 @@ struct btrfs_csum_item { * - the first 64k blank is useful for some boot loader/manager * - the first 1M could be scratched by buggy partitioner or somesuch */ -#define BTRFS_BLOCK_RESERVED_1M_FOR_SUPER ((u64)SZ_1M) +#define BTRFS_BLOCK_RESERVED_1M_FOR_SUPER ((u64)1 * 1024 * 1024) /* tag for the radix tree of block groups in ram */ #define BTRFS_BLOCK_GROUP_DATA (1ULL << 0) diff --git a/kernel-shared/send.h b/kernel-shared/send.h index 6df4f799..e73f09df 100644 --- a/kernel-shared/send.h +++ b/kernel-shared/send.h @@ -33,7 +33,7 @@ extern "C" { #define BTRFS_SEND_STREAM_MAGIC "btrfs-stream" #define BTRFS_SEND_STREAM_VERSION 1 -#define BTRFS_SEND_BUF_SIZE SZ_64K +#define BTRFS_SEND_BUF_SIZE (64 * 1024) #define BTRFS_SEND_READ_SIZE (1024 * 48) enum btrfs_tlv_type { diff --git a/kernel-shared/volumes.h b/kernel-shared/volumes.h index c371919c..33594518 100644 --- a/kernel-shared/volumes.h +++ b/kernel-shared/volumes.h @@ -21,6 +21,7 @@ #include "kerncompat.h" #include "kernel-shared/ctree.h" +#include "kernel-lib/sizes.h" #define BTRFS_STRIPE_LEN SZ_64K