Subject: 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 <neilb@suse.de>
This commit is contained in:
parent
adbb382b55
commit
a7322ae12f
2
bitmap.c
2
bitmap.c
|
@ -132,7 +132,7 @@ bitmap_info_t *bitmap_fd_read(int fd, int brief)
|
||||||
void *buf;
|
void *buf;
|
||||||
unsigned int n, skip;
|
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");
|
fprintf(stderr, Name ": failed to allocate 8192 bytes\n");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
|
@ -76,7 +76,7 @@ static int load_gpt(struct supertype *st, int fd, char *devname)
|
||||||
|
|
||||||
free_gpt(st);
|
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",
|
fprintf(stderr, Name ": %s could not allocate superblock\n",
|
||||||
__func__);
|
__func__);
|
||||||
return 1;
|
return 1;
|
||||||
|
|
Loading…
Reference in New Issue