qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [RFC][PATCH 1.8] block/iscsi: set bdi->cluster_size
@ 2013-11-25  8:29 Peter Lieven
  2013-11-25  8:54 ` Paolo Bonzini
  0 siblings, 1 reply; 3+ messages in thread
From: Peter Lieven @ 2013-11-25  8:29 UTC (permalink / raw)
  To: qemu-devel; +Cc: kwolf, pbonzini, Peter Lieven, ronniesahlberg, stefanha

this patch aims to set bdi->cluster_size to the internal page size
of the iscsi target so that enabled callers can align requests
properly.

Signed-off-by: Peter Lieven <pl@kamp.de>
---
 block/iscsi.c |    6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/block/iscsi.c b/block/iscsi.c
index b7b5238..3a4c5d4 100644
--- a/block/iscsi.c
+++ b/block/iscsi.c
@@ -1569,6 +1569,12 @@ static int iscsi_get_info(BlockDriverState *bs, BlockDriverInfo *bdi)
     IscsiLun *iscsilun = bs->opaque;
     bdi->unallocated_blocks_are_zero = !!iscsilun->lbprz;
     bdi->can_write_zeroes_with_unmap = iscsilun->lbprz && iscsilun->lbp.lbpws;
+    bdi->cluster_size = iscsilun->bl.opt_xfer_len * iscsilun->block_size;
+    /* if opt_xfer_len is not specified guess the internal page size of the
+     * iscsi target by the means of opt_unmap_gran */
+    if (bdi->cluster_size == 0) {
+        bdi->cluster_size = iscsilun->bl.opt_unmap_gran * iscsilun->block_size;
+    }
     return 0;
 }
 
-- 
1.7.9.5

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

end of thread, other threads:[~2013-11-25  9:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-25  8:29 [Qemu-devel] [RFC][PATCH 1.8] block/iscsi: set bdi->cluster_size Peter Lieven
2013-11-25  8:54 ` Paolo Bonzini
2013-11-25  9:01   ` Peter Lieven

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).