[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [RFC PATCH 13/17] block: fallback from discard to writes
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [RFC PATCH 13/17] block: fallback from discard to writes |
Date: |
Thu, 8 Mar 2012 18:15:13 +0100 |
Allow discard to fail, and fall back to the write operation. This
is needed because there's no simple way to probe for availability
of FALLOC_FL_PUNCH_HOLE.
Signed-off-by: Paolo Bonzini <address@hidden>
---
block.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/block.c b/block.c
index af73497..7397df6 100644
--- a/block.c
+++ b/block.c
@@ -1798,7 +1798,10 @@ static int coroutine_fn
bdrv_co_do_write_zeroes(BlockDriverState *bs,
bdi.discard_granularity &&
(sector_num & (bdi.discard_granularity - 1)) == 0 &&
(nb_sectors & (bdi.discard_granularity - 1)) == 0) {
- return bdrv_co_do_discard(bs, sector_num, nb_sectors);
+ ret = bdrv_co_do_discard(bs, sector_num, nb_sectors);
+ if (ret != -ENOTSUP) {
+ return ret;
+ }
}
if (qiov) {
--
1.7.7.6
- Re: [Qemu-devel] [RFC PATCH 14/17] block: support FALLOC_FL_PUNCH_HOLE trimming, (continued)
Re: [Qemu-devel] [RFC PATCH 14/17] block: support FALLOC_FL_PUNCH_HOLE trimming, Richard Laager, 2012/03/09
[Qemu-devel] [RFC PATCH 17/17] raw: implement is_allocated, Paolo Bonzini, 2012/03/08
[Qemu-devel] [RFC PATCH 13/17] block: fallback from discard to writes,
Paolo Bonzini <=