summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJes Sorensen <Jes.Sorensen@redhat.com>2012-03-20 17:54:06 +0100
committerNeilBrown <neilb@suse.de>2012-03-21 07:42:48 +1100
commitb2bfdfa0fe08326d5be894b08eedd1cf0744528a (patch)
tree5f38e394ce960bfde31cb77b171158be4cecbb92
parentad6db3cb959b7ffdeeed7366890b7e8b4b5e20ff (diff)
downloadmdadm-b2bfdfa0fe08326d5be894b08eedd1cf0744528a.tar.gz
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>
-rw-r--r--super1.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/super1.c b/super1.c
index af0abe6..5ed9945 100644
--- a/super1.c
+++ b/super1.c
@@ -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 */