From 8938bf152533b7e12e652f1d24dc3a9aad250271 Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Wed, 14 Dec 2011 11:17:34 +1100 Subject: [PATCH 1/2] bitmap: used 4K aligned buffers when reading the bitmap. This is needed on 4K block devices such as DASD as we do O_DIRECT reads. Do the same alignment for gpt just to be safe. Signed-off-by: NeilBrown --- bitmap.c | 2 +- super-gpt.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bitmap.c b/bitmap.c index d02f16e..8655f0c 100644 --- a/bitmap.c +++ b/bitmap.c @@ -132,7 +132,7 @@ bitmap_info_t *bitmap_fd_read(int fd, int brief) void *buf; unsigned int n, skip; - if (posix_memalign(&buf, 512, 8192) != 0) { + if (posix_memalign(&buf, 4096, 8192) != 0) { fprintf(stderr, Name ": failed to allocate 8192 bytes\n"); return NULL; } diff --git a/super-gpt.c b/super-gpt.c index b8c9aae..75269bf 100644 --- a/super-gpt.c +++ b/super-gpt.c @@ -76,7 +76,7 @@ static int load_gpt(struct supertype *st, int fd, char *devname) free_gpt(st); - if (posix_memalign((void**)&super, 512, 32*512) != 0) { + if (posix_memalign((void**)&super, 4096, 32*512) != 0) { fprintf(stderr, Name ": %s could not allocate superblock\n", __func__); return 1; -- 1.7.7