[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 07/19] block: do not parse BDRV_O_CACHE_WB in block
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PATCH 07/19] block: do not parse BDRV_O_CACHE_WB in block drivers |
Date: |
Mon, 24 Sep 2012 16:26:36 +0200 |
From: Jeff Cody <address@hidden>
Block drivers should ignore BDRV_O_CACHE_WB in .bdrv_open flags,
and in the bs->open_flags.
This patch removes the code, leaving the behaviour behind as if
BDRV_O_CACHE_WB was set.
Signed-off-by: Jeff Cody <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
block/iscsi.c | 4 ----
block/raw-posix.c | 3 ---
block/raw-win32.c | 3 ---
block/rbd.c | 6 ------
block/sheepdog.c | 14 ++++++--------
5 files changed, 6 insertions(+), 24 deletions(-)
diff --git a/block/iscsi.c b/block/iscsi.c
index 0b96165..70cf700 100644
--- a/block/iscsi.c
+++ b/block/iscsi.c
@@ -268,10 +268,6 @@ iscsi_aio_writev(BlockDriverState *bs, int64_t sector_num,
acb->task->xfer_dir = SCSI_XFER_WRITE;
acb->task->cdb_size = 16;
acb->task->cdb[0] = 0x8a;
- if (!(bs->open_flags & BDRV_O_CACHE_WB)) {
- /* set FUA on writes when cache mode is write through */
- acb->task->cdb[1] |= 0x04;
- }
lba = sector_qemu2lun(sector_num, iscsilun);
*(uint32_t *)&acb->task->cdb[2] = htonl(lba >> 32);
*(uint32_t *)&acb->task->cdb[6] = htonl(lba & 0xffffffff);
diff --git a/block/raw-posix.c b/block/raw-posix.c
index 155205f..288e7ff 100644
--- a/block/raw-posix.c
+++ b/block/raw-posix.c
@@ -202,9 +202,6 @@ static void raw_parse_flags(int bdrv_flags, int *open_flags)
if ((bdrv_flags & BDRV_O_NOCACHE)) {
*open_flags |= O_DIRECT;
}
- if (!(bdrv_flags & BDRV_O_CACHE_WB)) {
- *open_flags |= O_DSYNC;
- }
}
#ifdef CONFIG_LINUX_AIO
diff --git a/block/raw-win32.c b/block/raw-win32.c
index 335c06a..78c8306 100644
--- a/block/raw-win32.c
+++ b/block/raw-win32.c
@@ -92,9 +92,6 @@ static void raw_parse_flags(int flags, int *access_flags,
DWORD *overlapped)
if (flags & BDRV_O_NOCACHE) {
*overlapped |= FILE_FLAG_NO_BUFFERING;
}
- if (!(flags & BDRV_O_CACHE_WB)) {
- *overlapped |= FILE_FLAG_WRITE_THROUGH;
- }
}
static int raw_open(BlockDriverState *bs, const char *filename, int flags)
diff --git a/block/rbd.c b/block/rbd.c
index 5a0f79f..015a9db 100644
--- a/block/rbd.c
+++ b/block/rbd.c
@@ -487,12 +487,6 @@ static int qemu_rbd_open(BlockDriverState *bs, const char
*filename, int flags)
rados_conf_set(s->cluster, "rbd_cache", "false");
} else {
rados_conf_set(s->cluster, "rbd_cache", "true");
- if (!(flags & BDRV_O_CACHE_WB)) {
- r = rados_conf_set(s->cluster, "rbd_cache_max_dirty", "0");
- if (r < 0) {
- rados_conf_set(s->cluster, "rbd_cache", "false");
- }
- }
}
if (strstr(conf, "conf=") == NULL) {
diff --git a/block/sheepdog.c b/block/sheepdog.c
index e0753ee..4742f8a 100644
--- a/block/sheepdog.c
+++ b/block/sheepdog.c
@@ -1114,14 +1114,12 @@ static int sd_open(BlockDriverState *bs, const char
*filename, int flags)
goto out;
}
- if (flags & BDRV_O_CACHE_WB) {
- s->cache_enabled = 1;
- s->flush_fd = connect_to_sdog(s->addr, s->port);
- if (s->flush_fd < 0) {
- error_report("failed to connect");
- ret = s->flush_fd;
- goto out;
- }
+ s->cache_enabled = 1;
+ s->flush_fd = connect_to_sdog(s->addr, s->port);
+ if (s->flush_fd < 0) {
+ error_report("failed to connect");
+ ret = s->flush_fd;
+ goto out;
}
if (snapid || tag[0] != '\0') {
--
1.7.6.5
- [Qemu-devel] [PATCH 02/19] block: correctly set the keep_read_only flag, (continued)
- [Qemu-devel] [PATCH 02/19] block: correctly set the keep_read_only flag, Kevin Wolf, 2012/09/24
- [Qemu-devel] [PATCH 03/19] block: make bdrv_set_enable_write_cache() modify open_flags, Kevin Wolf, 2012/09/24
- [Qemu-devel] [PATCH 10/19] block: raw-posix image file reopen, Kevin Wolf, 2012/09/24
- [Qemu-devel] [PATCH 05/19] block: move aio initialization into a helper function, Kevin Wolf, 2012/09/24
- [Qemu-devel] [PATCH 13/19] block: qcow2 image file reopen, Kevin Wolf, 2012/09/24
- [Qemu-devel] [PATCH 06/19] block: move open flag parsing in raw block drivers to helper functions, Kevin Wolf, 2012/09/24
- [Qemu-devel] [PATCH 08/19] block: use BDRV_O_NOCACHE instead of s->aligned_buf in raw-posix.c, Kevin Wolf, 2012/09/24
- [Qemu-devel] [PATCH 12/19] block: qed image file reopen, Kevin Wolf, 2012/09/24
- [Qemu-devel] [PATCH 11/19] block: raw image file reopen, Kevin Wolf, 2012/09/24
- [Qemu-devel] [PATCH 09/19] block: purge s->aligned_buf and s->aligned_buf_size from raw-posix.c, Kevin Wolf, 2012/09/24
- [Qemu-devel] [PATCH 07/19] block: do not parse BDRV_O_CACHE_WB in block drivers,
Kevin Wolf <=
- [Qemu-devel] [PATCH 18/19] block: convert bdrv_commit() to use bdrv_reopen(), Kevin Wolf, 2012/09/24
- [Qemu-devel] [PATCH 04/19] block: Framework for reopening files safely, Kevin Wolf, 2012/09/24
- [Qemu-devel] [PATCH 14/19] block: qcow image file reopen, Kevin Wolf, 2012/09/24
- [Qemu-devel] [PATCH 15/19] block: vmdk image file reopen, Kevin Wolf, 2012/09/24
- [Qemu-devel] [PATCH 17/19] block: vpc image file reopen, Kevin Wolf, 2012/09/24
- [Qemu-devel] [PATCH 16/19] block: vdi image file reopen, Kevin Wolf, 2012/09/24
- [Qemu-devel] [PATCH 19/19] block: remove keep_read_only flag from BlockDriverState struct, Kevin Wolf, 2012/09/24
- Re: [Qemu-devel] [PULL 00/19] Block patches, Anthony Liguori, 2012/09/25