All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: qemu-devel@nongnu.org
Cc: kwolf@redhat.com, qemu-block@nongnu.org,
	Stefan Hajnoczi <stefanha@redhat.com>,
	Fam Zheng <famz@redhat.com>, Max Reitz <mreitz@redhat.com>
Subject: [Qemu-devel] [PATCH v2 13/13] block: Kill bdrv_co_write_zeroes()
Date: Wed,  1 Jun 2016 15:10:13 -0600	[thread overview]
Message-ID: <1464815413-613-14-git-send-email-eblake@redhat.com> (raw)
In-Reply-To: <1464815413-613-1-git-send-email-eblake@redhat.com>

Now that all drivers have been converted to a byte interface,
we no longer need a sector interface.

Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
---
 include/block/block_int.h |  2 --
 block/io.c                | 15 ++-------------
 2 files changed, 2 insertions(+), 15 deletions(-)

diff --git a/include/block/block_int.h b/include/block/block_int.h
index 1dfdf92..8a4963c 100644
--- a/include/block/block_int.h
+++ b/include/block/block_int.h
@@ -163,8 +163,6 @@ struct BlockDriver {
      * function pointer may be NULL or return -ENOSUP and .bdrv_co_writev()
      * will be called instead.
      */
-    int coroutine_fn (*bdrv_co_write_zeroes)(BlockDriverState *bs,
-        int64_t sector_num, int nb_sectors, BdrvRequestFlags flags);
     int coroutine_fn (*bdrv_co_pwrite_zeroes)(BlockDriverState *bs,
         int64_t offset, int count, BdrvRequestFlags flags);
     int coroutine_fn (*bdrv_co_discard)(BlockDriverState *bs,
diff --git a/block/io.c b/block/io.c
index 5f021d5..6013b97 100644
--- a/block/io.c
+++ b/block/io.c
@@ -901,7 +901,7 @@ static int coroutine_fn bdrv_co_do_copy_on_readv(BlockDriverState *bs,
         goto err;
     }

-    if ((drv->bdrv_co_write_zeroes || drv->bdrv_co_pwrite_zeroes) &&
+    if (drv->bdrv_co_pwrite_zeroes &&
         buffer_is_zero(bounce_buffer, iov.iov_len)) {
         ret = bdrv_co_do_pwrite_zeroes(bs,
                                        cluster_sector_num * BDRV_SECTOR_SIZE,
@@ -1170,16 +1170,6 @@ static int coroutine_fn bdrv_co_do_pwrite_zeroes(BlockDriverState *bs,
                 !(bs->supported_zero_flags & BDRV_REQ_FUA)) {
                 need_flush = true;
             }
-        } else if (drv->bdrv_co_write_zeroes) {
-            assert(offset % BDRV_SECTOR_SIZE == 0);
-            assert(count % BDRV_SECTOR_SIZE == 0);
-            ret = drv->bdrv_co_write_zeroes(bs, offset >> BDRV_SECTOR_BITS,
-                                            num >> BDRV_SECTOR_BITS,
-                                            flags & bs->supported_zero_flags);
-            if (ret != -ENOTSUP && (flags & BDRV_REQ_FUA) &&
-                !(bs->supported_zero_flags & BDRV_REQ_FUA)) {
-                need_flush = true;
-            }
         } else {
             assert(!bs->supported_zero_flags);
         }
@@ -1259,8 +1249,7 @@ static int coroutine_fn bdrv_aligned_pwritev(BlockDriverState *bs,
     ret = notifier_with_return_list_notify(&bs->before_write_notifiers, req);

     if (!ret && bs->detect_zeroes != BLOCKDEV_DETECT_ZEROES_OPTIONS_OFF &&
-        !(flags & BDRV_REQ_ZERO_WRITE) &&
-        (drv->bdrv_co_pwrite_zeroes || drv->bdrv_co_write_zeroes) &&
+        !(flags & BDRV_REQ_ZERO_WRITE) && drv->bdrv_co_pwrite_zeroes &&
         qemu_iovec_is_zero(qiov)) {
         flags |= BDRV_REQ_ZERO_WRITE;
         if (bs->detect_zeroes == BLOCKDEV_DETECT_ZEROES_OPTIONS_UNMAP) {
-- 
2.5.5

  parent reply	other threads:[~2016-06-01 21:10 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-01 21:10 [Qemu-devel] [PATCH v2 00/13] Kill sector-based write_zeroes Eric Blake
2016-06-01 21:10 ` [Qemu-devel] [PATCH v2 01/13] iscsi: Use block size as minimum zero/discard alignment Eric Blake
2016-06-01 21:10 ` [Qemu-devel] [PATCH v2 02/13] block: Track write zero limits in bytes Eric Blake
2016-06-01 21:10 ` [Qemu-devel] [PATCH v2 03/13] block: Add .bdrv_co_pwrite_zeroes() Eric Blake
2016-06-01 21:10 ` [Qemu-devel] [PATCH v2 04/13] block: Switch bdrv_write_zeroes() to byte interface Eric Blake
2016-06-02 11:01   ` Kevin Wolf
2016-06-01 21:10 ` [Qemu-devel] [PATCH v2 05/13] iscsi: Convert to bdrv_co_pwrite_zeroes() Eric Blake
2016-06-01 21:10 ` [Qemu-devel] [PATCH v2 06/13] qcow2: " Eric Blake
2016-06-01 21:10 ` [Qemu-devel] [PATCH v2 07/13] blkreplay: " Eric Blake
2016-06-01 21:10 ` [Qemu-devel] [PATCH v2 08/13] gluster: " Eric Blake
2016-06-01 21:10 ` [Qemu-devel] [PATCH v2 09/13] qed: " Eric Blake
2016-06-02 11:16   ` Kevin Wolf
2016-06-02 12:40     ` Eric Blake
2016-06-02 12:45       ` Kevin Wolf
2016-06-01 21:10 ` [Qemu-devel] [PATCH v2 10/13] raw-posix: " Eric Blake
2016-06-03 16:21   ` Kevin Wolf
2016-06-01 21:10 ` [Qemu-devel] [PATCH v2 11/13] raw_bsd: " Eric Blake
2016-06-01 21:10 ` [Qemu-devel] [PATCH v2 12/13] vmdk: " Eric Blake
2016-06-01 21:10 ` Eric Blake [this message]
2016-06-02 11:26 ` [Qemu-devel] [PATCH v2 00/13] Kill sector-based write_zeroes Kevin Wolf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1464815413-613-14-git-send-email-eblake@redhat.com \
    --to=eblake@redhat.com \
    --cc=famz@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.