diff options
author | NeilBrown <neilb@suse.de> | 2008-10-17 03:46:23 +0200 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2008-10-17 03:46:23 +0200 |
commit | 492350045c7e40741069caa7d017209439db665b (patch) | |
tree | 48ddb56482580bb809830ddc6971a79459d0ca72 /bitmap.c | |
parent | mdmon: suicide prevention (diff) | |
parent | Remove .UR .UE macros from man page because the don't do what we want. (diff) | |
download | mdadm-492350045c7e40741069caa7d017209439db665b.tar.xz mdadm-492350045c7e40741069caa7d017209439db665b.zip |
Merge branch 'master' into devel-3.0
Conflicts:
Manage.c
Diffstat (limited to 'bitmap.c')
-rw-r--r-- | bitmap.c | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -115,6 +115,15 @@ unsigned long long bitmap_bits(unsigned long long array_size, return (array_size * 512 + chunksize - 1) / chunksize; } +unsigned long bitmap_sectors(struct bitmap_super_s *bsb) +{ + unsigned long long bits = bitmap_bits(__le64_to_cpu(bsb->sync_size), + __le32_to_cpu(bsb->chunksize)); + int bits_per_sector = 8*512; + return (bits + bits_per_sector - 1) / bits_per_sector; +} + + bitmap_info_t *bitmap_fd_read(int fd, int brief) { /* Note: fd might be open O_DIRECT, so we must be |