]> git.ipfire.org Git - thirdparty/mdadm.git/commit - mdadm.h
super1: make internal bitmap size calculations more consistent
authorArtur Paszkiewicz <artur.paszkiewicz@intel.com>
Thu, 10 Nov 2016 10:50:53 +0000 (11:50 +0100)
committerJes Sorensen <Jes.Sorensen@redhat.com>
Wed, 16 Nov 2016 14:56:39 +0000 (09:56 -0500)
commit561ad5597bf472f8114260d144a5e8ba5c7246d5
tree34b08ecabe680f23ca61110809771eabc5833f5d
parent52a94085618472abf768aa32c5ebe22336433fa5
super1: make internal bitmap size calculations more consistent

Determining internal bitmap size is performed using two different
functions (bitmap_sectors() and calc_bitmap_size()) and in
getinfo_super1() it is calculated in yet another way. Each of these
methods give slightly different results. The most accurate is
calc_bitmap_size() but it also has a rounding issue. So:

- fix the rounding issue in calc_bitmap_size() using bitmap_bits()
- replace usages of bitmap_sectors() and open-coded calculations with
  calc_bitmap_size()
- remove bitmap_sectors()
- move bitmap_bits() to mdadm.h as inline - otherwise mdassemble won't
  compile (it does not use bitmap.c)

Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
bitmap.c
mdadm.h
super1.c