diff options
author | Qu Wenruo <quwenruo@cn.fujitsu.com> | 2017-01-24 11:03:05 +0800 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2017-03-08 13:00:45 +0100 |
commit | a2203246ae483d09114329d5d1f898efb23d6168 (patch) | |
tree | 40cea3c2a1293e7f23559c5183cf92c22312321b /disk-io.h | |
parent | 95f515f2d12fb1c1b5a01e03d9f709570b762eeb (diff) |
btrfs-progs: Introduce kernel sizes to cleanup large intermediate number
Large numbers like (1024 * 1024 * 1024) may cost reader/reviewer to
waste one second to convert to 1G.
Introduce kernel include/linux/sizes.h to replace any intermediate
number larger than 4096 (not including 4096) to SZ_*.
Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'disk-io.h')
-rw-r--r-- | disk-io.h | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -21,8 +21,9 @@ #include "kerncompat.h" #include "ctree.h" +#include "sizes.h" -#define BTRFS_SUPER_INFO_OFFSET (64 * 1024) +#define BTRFS_SUPER_INFO_OFFSET SZ_64K #define BTRFS_SUPER_INFO_SIZE 4096 #define BTRFS_SUPER_MIRROR_MAX 3 @@ -99,7 +100,7 @@ enum btrfs_read_sb_flags { static inline u64 btrfs_sb_offset(int mirror) { - u64 start = 16 * 1024; + u64 start = SZ_16K; if (mirror) return start << (BTRFS_SUPER_MIRROR_SHIFT * mirror); return BTRFS_SUPER_INFO_OFFSET; |