diff options
author | Zhao Lei <zhaolei@cn.fujitsu.com> | 2014-12-08 12:55:57 +0100 |
---|---|---|
committer | Chris Mason <clm@fb.com> | 2016-01-20 16:22:15 +0100 |
commit | bfca9a6d4b1322ba36235e8a652f05a9668ef59b (patch) | |
tree | 863e7cad45616ddc8a5417919d696ced884ddd2e /fs/btrfs/scrub.c | |
parent | btrfs: Fix no_space in write and rm loop (diff) | |
download | linux-bfca9a6d4b1322ba36235e8a652f05a9668ef59b.tar.xz linux-bfca9a6d4b1322ba36235e8a652f05a9668ef59b.zip |
btrfs: Fix calculation of rbio->dbitmap's size calculation
Current code is trying to calculate rbio->dbitmap's size to make it
align to sizeof(long), but implement haven't achived this object,
it is align to sizeof(char) instead.
This patch fixed above calculation, and use sizeof(long) instead of
fixed "8" to increate compatibility.
Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com>
Signed-off-by: Chris Mason <clm@fb.com>
Diffstat (limited to 'fs/btrfs/scrub.c')
-rw-r--r-- | fs/btrfs/scrub.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c index 681db07f25ea..b1a68530e911 100644 --- a/fs/btrfs/scrub.c +++ b/fs/btrfs/scrub.c @@ -2813,7 +2813,7 @@ out: static inline int scrub_calc_parity_bitmap_len(int nsectors) { - return DIV_ROUND_UP(nsectors, BITS_PER_LONG) * (BITS_PER_LONG / 8); + return DIV_ROUND_UP(nsectors, BITS_PER_LONG) * sizeof(long); } static void scrub_parity_get(struct scrub_parity *sparity) |