All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: qemu-devel@nongnu.org
Cc: qemu-block@nongnu.org, jsnow@redhat.com,
	Stefan Hajnoczi <stefanha@redhat.com>,
	Fam Zheng <famz@redhat.com>, Kevin Wolf <kwolf@redhat.com>,
	Max Reitz <mreitz@redhat.com>
Subject: [Qemu-devel] [PATCH v2 13/20] block: Drop unused bdrv_round_sectors_to_clusters()
Date: Wed, 10 May 2017 21:20:29 -0500	[thread overview]
Message-ID: <20170511022036.32225-14-eblake@redhat.com> (raw)
In-Reply-To: <20170511022036.32225-1-eblake@redhat.com>

Now that the last user [mirror_iteration()] has converted to using
bytes, we no longer need a function to round sectors to clusters.

Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: John Snow <jsnow@redhat.com>

---
v2: hoist to earlier series, no change
---
 include/block/block.h |  4 ----
 block/io.c            | 21 ---------------------
 2 files changed, 25 deletions(-)

diff --git a/include/block/block.h b/include/block/block.h
index 14fba5e..96ece29 100644
--- a/include/block/block.h
+++ b/include/block/block.h
@@ -481,10 +481,6 @@ const char *bdrv_get_device_or_node_name(const BlockDriverState *bs);
 int bdrv_get_flags(BlockDriverState *bs);
 int bdrv_get_info(BlockDriverState *bs, BlockDriverInfo *bdi);
 ImageInfoSpecific *bdrv_get_specific_info(BlockDriverState *bs);
-void bdrv_round_sectors_to_clusters(BlockDriverState *bs,
-                                    int64_t sector_num, int nb_sectors,
-                                    int64_t *cluster_sector_num,
-                                    int *cluster_nb_sectors);
 void bdrv_round_to_clusters(BlockDriverState *bs,
                             int64_t offset, unsigned int bytes,
                             int64_t *cluster_offset,
diff --git a/block/io.c b/block/io.c
index fdd7485..88ae8b0 100644
--- a/block/io.c
+++ b/block/io.c
@@ -436,27 +436,6 @@ static void mark_request_serialising(BdrvTrackedRequest *req, uint64_t align)
 }

 /**
- * Round a region to cluster boundaries (sector-based)
- */
-void bdrv_round_sectors_to_clusters(BlockDriverState *bs,
-                                    int64_t sector_num, int nb_sectors,
-                                    int64_t *cluster_sector_num,
-                                    int *cluster_nb_sectors)
-{
-    BlockDriverInfo bdi;
-
-    if (bdrv_get_info(bs, &bdi) < 0 || bdi.cluster_size == 0) {
-        *cluster_sector_num = sector_num;
-        *cluster_nb_sectors = nb_sectors;
-    } else {
-        int64_t c = bdi.cluster_size / BDRV_SECTOR_SIZE;
-        *cluster_sector_num = QEMU_ALIGN_DOWN(sector_num, c);
-        *cluster_nb_sectors = QEMU_ALIGN_UP(sector_num - *cluster_sector_num +
-                                            nb_sectors, c);
-    }
-}
-
-/**
  * Round a region to cluster boundaries
  */
 void bdrv_round_to_clusters(BlockDriverState *bs,
-- 
2.9.3

  parent reply	other threads:[~2017-05-11  2:21 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-11  2:20 [Qemu-devel] [PATCH v2 00/20] make bdrv_is_allocated[_above] byte-based Eric Blake
2017-05-11  2:20 ` [Qemu-devel] [PATCH v2 01/20] blockjob: Track job ratelimits via bytes, not sectors Eric Blake
2017-05-11  2:20 ` [Qemu-devel] [PATCH v2 02/20] trace: Show blockjob actions " Eric Blake
2017-05-11  2:20 ` [Qemu-devel] [PATCH v2 03/20] stream: Switch stream_populate() to byte-based Eric Blake
2017-05-11  2:20 ` [Qemu-devel] [PATCH v2 04/20] stream: Switch stream_run() " Eric Blake
2017-05-11  2:20 ` [Qemu-devel] [PATCH v2 05/20] commit: Switch commit_populate() " Eric Blake
2017-05-11  2:20 ` [Qemu-devel] [PATCH v2 06/20] commit: Switch commit_run() " Eric Blake
2017-05-11  2:20 ` [Qemu-devel] [PATCH v2 07/20] mirror: Switch MirrorBlockJob " Eric Blake
2017-05-11  2:20 ` [Qemu-devel] [PATCH v2 08/20] mirror: Switch mirror_do_zero_or_discard() " Eric Blake
2017-05-11  2:20 ` [Qemu-devel] [PATCH v2 09/20] mirror: Update signature of mirror_clip_sectors() Eric Blake
2017-06-05 22:23   ` John Snow
2017-05-11  2:20 ` [Qemu-devel] [PATCH v2 10/20] mirror: Switch mirror_cow_align() to byte-based Eric Blake
2017-06-05 22:24   ` John Snow
2017-05-11  2:20 ` [Qemu-devel] [PATCH v2 11/20] mirror: Switch mirror_do_read() " Eric Blake
2017-05-11  2:20 ` [Qemu-devel] [PATCH v2 12/20] mirror: Switch mirror_iteration() " Eric Blake
2017-05-11  2:20 ` Eric Blake [this message]
2017-05-11  2:20 ` [Qemu-devel] [PATCH v2 14/20] backup: Switch BackupBlockJob " Eric Blake
2017-05-11  2:20 ` [Qemu-devel] [PATCH v2 15/20] backup: Switch block_backup.h " Eric Blake
2017-06-05 22:42   ` John Snow
2017-05-11  2:20 ` [Qemu-devel] [PATCH v2 16/20] backup: Switch backup_do_cow() " Eric Blake
2017-05-11  2:20 ` [Qemu-devel] [PATCH v2 17/20] backup: Switch backup_run() " Eric Blake
2017-05-11  2:20 ` [Qemu-devel] [PATCH v2 18/20] block: Make bdrv_is_allocated() byte-based Eric Blake
2017-06-05 22:57   ` John Snow
2017-05-11  2:20 ` [Qemu-devel] [PATCH v2 19/20] block: Minimize raw use of bds->total_sectors Eric Blake
2017-05-11  2:20 ` [Qemu-devel] [PATCH v2 20/20] block: Make bdrv_is_allocated_above() byte-based Eric Blake
2017-06-05 23:22   ` John Snow
2017-06-05 23:30   ` John Snow
2017-06-05 19:39 ` [Qemu-devel] [PATCH v2 00/20] make bdrv_is_allocated[_above] byte-based Eric Blake
2017-06-05 19:41   ` John Snow

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=20170511022036.32225-14-eblake@redhat.com \
    --to=eblake@redhat.com \
    --cc=famz@redhat.com \
    --cc=jsnow@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.