qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Hanna Reitz <hreitz@redhat.com>
To: qemu-block@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>, Hanna Reitz <hreitz@redhat.com>,
	Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>,
	qemu-devel@nongnu.org
Subject: [PATCH v3 6/6] block/iscsi: Do not force-cap *pnum
Date: Thu, 12 Aug 2021 10:41:48 +0200	[thread overview]
Message-ID: <20210812084148.14458-7-hreitz@redhat.com> (raw)
In-Reply-To: <20210812084148.14458-1-hreitz@redhat.com>

bdrv_co_block_status() does it for us, we do not need to do it here.

The advantage of not capping *pnum is that bdrv_co_block_status() can
cache larger data regions than requested by its caller.

Signed-off-by: Hanna Reitz <hreitz@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
---
 block/iscsi.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/block/iscsi.c b/block/iscsi.c
index 4d2a416ce7..852384086b 100644
--- a/block/iscsi.c
+++ b/block/iscsi.c
@@ -781,9 +781,6 @@ retry:
         iscsi_allocmap_set_allocated(iscsilun, offset, *pnum);
     }
 
-    if (*pnum > bytes) {
-        *pnum = bytes;
-    }
 out_unlock:
     qemu_mutex_unlock(&iscsilun->mutex);
     g_free(iTask.err_str);
-- 
2.31.1



  parent reply	other threads:[~2021-08-12  8:45 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-12  8:41 [PATCH v3 0/6] block-status cache for data regions Hanna Reitz
2021-08-12  8:41 ` [PATCH v3 1/6] block: Drop BDS comment regarding bdrv_append() Hanna Reitz
2021-08-12  8:41 ` [PATCH v3 2/6] block: block-status cache for data regions Hanna Reitz
2021-08-16 21:38   ` Eric Blake
2021-08-17  6:19     ` Hanna Reitz
2021-08-25  9:54   ` Vladimir Sementsov-Ogievskiy
2021-08-12  8:41 ` [PATCH v3 3/6] block: Clarify that @bytes is no limit on *pnum Hanna Reitz
2021-08-17 15:03   ` Eric Blake
2021-08-12  8:41 ` [PATCH v3 4/6] block/file-posix: Do not force-cap *pnum Hanna Reitz
2021-08-12  8:41 ` [PATCH v3 5/6] block/gluster: " Hanna Reitz
2021-08-12  8:41 ` Hanna Reitz [this message]
2021-09-07  9:23 ` [PATCH v3 0/6] block-status cache for data regions Hanna Reitz

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=20210812084148.14458-7-hreitz@redhat.com \
    --to=hreitz@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=vsementsov@virtuozzo.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 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).