summaryrefslogtreecommitdiffstats
path: root/bitmap.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2013-02-05 05:34:17 +0100
committerNeilBrown <neilb@suse.de>2013-02-05 06:00:55 +0100
commit9698df15d9efaa32d30e17ff839315cedf1e7984 (patch)
treedbbe22c79f5ef36cdf0c1ece9e743b80a3eb50b5 /bitmap.c
parentDetail: print correct size for large external-metadata arrays. (diff)
downloadmdadm-9698df15d9efaa32d30e17ff839315cedf1e7984.tar.xz
mdadm-9698df15d9efaa32d30e17ff839315cedf1e7984.zip
Avoid using BLKFLSBUF.
Now that we use O_DIRECT for all device IO, BLKFLSBUF is not needed to ensure we get current data, and it can impose a cost if any flush-out is needed. So remove it. To be safe, add O_DIRECT to one place where it isn't currently used: when reading a bitmap. Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'bitmap.c')
-rw-r--r--bitmap.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/bitmap.c b/bitmap.c
index 97f33ffa..028225d5 100644
--- a/bitmap.c
+++ b/bitmap.c
@@ -207,7 +207,7 @@ bitmap_info_t *bitmap_file_read(char *filename, int brief, struct supertype **st
return NULL;
}
if ((S_IFMT & stb.st_mode) == S_IFBLK) {
- fd = open(filename, O_RDONLY);
+ fd = open(filename, O_RDONLY|O_DIRECT);
if (fd < 0) {
pr_err("failed to open bitmap file %s: %s\n",
filename, strerror(errno));
@@ -225,7 +225,6 @@ bitmap_info_t *bitmap_file_read(char *filename, int brief, struct supertype **st
} else
st->ss->locate_bitmap(st, fd);
- ioctl(fd, BLKFLSBUF, 0); /* make sure we read current data */
*stp = st;
} else {
fd = open(filename, O_RDONLY|O_DIRECT);