[PATCH 01/11] super1.c don't keep recalculating bitmap pointer

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Jes Sorensen <Jes.Sorensen@xxxxxxxxxx>

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

Signed-off-by: Jes Sorensen <Jes.Sorensen@xxxxxxxxxx>
---
 super1.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/super1.c b/super1.c
index 341ad53..4e3bf7b 100644
--- a/super1.c
+++ b/super1.c
@@ -1389,8 +1389,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)+1024, 512)
-	    != 512)
+	if (aread(fd, bsb, 512) != 512)
 		goto no_bitmap;
 
 	uuid_from_super1(st, uuid);
@@ -1657,7 +1656,7 @@ static int write_bitmap1(struct supertype *st, int fd)
 		return -ENOMEM;
 
 	memset(buf, 0xff, 4096);
-	memcpy(buf, ((char*)sb)+1024, 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 */
-- 
1.7.7.6

--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux