diff options
author | NeilBrown <neilb@suse.de> | 2015-07-20 09:17:37 +0200 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2015-07-20 09:17:37 +0200 |
commit | 12ee2a8d75067a9cadfedecf2af36f6c2aedf25d (patch) | |
tree | 674c83653de99f43a9ab2615aaa26ad24297319a /raid6check.c | |
parent | restripe: fix data block order in raid6_2_data_recov (diff) | |
download | mdadm-12ee2a8d75067a9cadfedecf2af36f6c2aedf25d.tar.xz mdadm-12ee2a8d75067a9cadfedecf2af36f6c2aedf25d.zip |
raid6check: use O_DIRECT instead of O_SYNC.
O_DIRECT is more direct and is faster.
This requires aligned memory allocation, but that isn't hard.
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'raid6check.c')
-rw-r--r-- | raid6check.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/raid6check.c b/raid6check.c index b2e17323..cb8522e5 100644 --- a/raid6check.c +++ b/raid6check.c @@ -312,7 +312,7 @@ int check_stripes(struct mdinfo *info, int *source, unsigned long long *offsets, /* read the data and p and q blocks, and check we got them right */ int data_disks = raid_disks - 2; int syndrome_disks = data_disks + is_ddf(layout) * 2; - char *stripe_buf = xmalloc(raid_disks * chunk_size); + char *stripe_buf; /* stripes[] is indexed by raid_disk and holds chunks from each device */ char **stripes = xmalloc(raid_disks * sizeof(char*)); @@ -349,6 +349,7 @@ int check_stripes(struct mdinfo *info, int *source, unsigned long long *offsets, if (!tables_ready) make_tables(); + posix_memalign((void**)&stripe_buf, 4096, raid_disks * chunk_size); block_index_for_slot += 2; blocks += 2; blocks_page += 2; @@ -675,7 +676,7 @@ int main(int argc, char *argv[]) if(disk_slot >= 0) { disk_name[disk_slot] = map_dev(comp->disk.major, comp->disk.minor, 0); offsets[disk_slot] = comp->data_offset * 512; - fds[disk_slot] = open(disk_name[disk_slot], O_RDWR | O_SYNC); + fds[disk_slot] = open(disk_name[disk_slot], O_RDWR | O_DIRECT); if (fds[disk_slot] < 0) { perror(disk_name[disk_slot]); fprintf(stderr,"%s: cannot open %s\n", prg, disk_name[disk_slot]); |