qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] virtio-blk: trivial code optimization
@ 2015-11-06  1:04 arei.gonglei
  2015-11-06 10:35 ` Stefan Hajnoczi
  0 siblings, 1 reply; 4+ messages in thread
From: arei.gonglei @ 2015-11-06  1:04 UTC (permalink / raw)
  To: qemu-devel; +Cc: kwolf, Gonglei, qemu-block, stefanha, mst

From: Gonglei <arei.gonglei@huawei.com>

Signed-off-by: Gonglei <arei.gonglei@huawei.com>
---
 hw/block/virtio-blk.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c
index 093e475..752586d 100644
--- a/hw/block/virtio-blk.c
+++ b/hw/block/virtio-blk.c
@@ -409,18 +409,20 @@ void virtio_blk_submit_multireq(BlockBackend *blk, MultiReqBuffer *mrb)
             /* merge would exceed maximum number of IOVs */
             if (niov + req->qiov.niov > IOV_MAX) {
                 merge = false;
+                goto unmerge;
             }
 
             /* merge would exceed maximum transfer length of backend device */
             if (req->qiov.size / BDRV_SECTOR_SIZE + nb_sectors > max_xfer_len) {
                 merge = false;
+                goto unmerge;
             }
 
             /* requests are not sequential */
             if (sector_num + nb_sectors != req->sector_num) {
                 merge = false;
             }
-
+unmerge:
             if (!merge) {
                 submit_requests(blk, mrb, start, num_reqs, niov);
                 num_reqs = 0;
-- 
1.7.12.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-11-09  2:08 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-06  1:04 [Qemu-devel] [PATCH] virtio-blk: trivial code optimization arei.gonglei
2015-11-06 10:35 ` Stefan Hajnoczi
2015-11-06 12:54   ` Paolo Bonzini
2015-11-09  2:08     ` Gonglei

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).