super1.c don't keep recalculating bitmap pointer

We just calculated the pointer to the bitmap, so use it instead of
recalculating.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: NeilBrown <neilb@suse.de>
This commit is contained in:
Jes Sorensen 2012-03-20 17:54:06 +01:00 committed by NeilBrown
parent ad6db3cb95
commit b2bfdfa0fe
1 changed files with 2 additions and 3 deletions

View File

@ -1395,8 +1395,7 @@ static int load_super1(struct supertype *st, int fd, char *devname)
* should get that written out.
*/
locate_bitmap1(st, fd);
if (aread(fd, ((char*)super)+MAX_SB_SIZE, 512)
!= 512)
if (aread(fd, bsb, 512) != 512)
goto no_bitmap;
uuid_from_super1(st, uuid);
@ -1663,7 +1662,7 @@ static int write_bitmap1(struct supertype *st, int fd)
return -ENOMEM;
memset(buf, 0xff, 4096);
memcpy(buf, ((char*)sb)+MAX_SB_SIZE, sizeof(bitmap_super_t));
memcpy(buf, (char *)bms, sizeof(bitmap_super_t));
towrite = __le64_to_cpu(bms->sync_size) / (__le32_to_cpu(bms->chunksize)>>9);
towrite = (towrite+7) >> 3; /* bits to bytes */