diff options
-rw-r--r-- | block/io.c | 9 | ||||
-rw-r--r-- | include/block/block_int.h | 2 |
2 files changed, 2 insertions, 9 deletions
diff --git a/block/io.c b/block/io.c index 5ba0195a69..7323f0fb7b 100644 --- a/block/io.c +++ b/block/io.c @@ -2423,14 +2423,12 @@ int coroutine_fn bdrv_co_pdiscard(BlockDriverState *bs, int64_t offset, return 0; } - if (!bs->drv->bdrv_co_discard && !bs->drv->bdrv_co_pdiscard && - !bs->drv->bdrv_aio_pdiscard) { + if (!bs->drv->bdrv_co_pdiscard && !bs->drv->bdrv_aio_pdiscard) { return 0; } /* Discard is advisory, so ignore any unaligned head or tail */ - align = MAX(BDRV_SECTOR_SIZE, - MAX(bs->bl.pdiscard_alignment, bs->bl.request_alignment)); + align = MAX(bs->bl.pdiscard_alignment, bs->bl.request_alignment); assert(is_power_of_2(align)); head = MIN(count, -offset & (align - 1)); if (head) { @@ -2458,9 +2456,6 @@ int coroutine_fn bdrv_co_pdiscard(BlockDriverState *bs, int64_t offset, if (bs->drv->bdrv_co_pdiscard) { ret = bs->drv->bdrv_co_pdiscard(bs, offset, num); - } else if (bs->drv->bdrv_co_discard) { - ret = bs->drv->bdrv_co_discard(bs, offset >> BDRV_SECTOR_BITS, - num >> BDRV_SECTOR_BITS); } else { BlockAIOCB *acb; CoroutineIOCompletion co = { diff --git a/include/block/block_int.h b/include/block/block_int.h index 8f16d1652e..a069f97b37 100644 --- a/include/block/block_int.h +++ b/include/block/block_int.h @@ -165,8 +165,6 @@ struct BlockDriver { */ int coroutine_fn (*bdrv_co_pwrite_zeroes)(BlockDriverState *bs, int64_t offset, int count, BdrvRequestFlags flags); - int coroutine_fn (*bdrv_co_discard)(BlockDriverState *bs, - int64_t sector_num, int nb_sectors); int coroutine_fn (*bdrv_co_pdiscard)(BlockDriverState *bs, int64_t offset, int count); int64_t coroutine_fn (*bdrv_co_get_block_status)(BlockDriverState *bs, |