Skip to content

Commit

Permalink
block/iscsi: clarify the meaning of ISCSI_CHECKALLOC_THRES
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Lieven <pl@kamp.de>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
  • Loading branch information
plieven authored and bonzini committed Apr 29, 2014
1 parent b03c380 commit 5917af8
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions block/iscsi.c
Expand Up @@ -95,7 +95,15 @@ typedef struct IscsiAIOCB {
#define NOP_INTERVAL 5000
#define MAX_NOP_FAILURES 3
#define ISCSI_CMD_RETRIES 5
#define ISCSI_CHECKALLOC_THRES 63

/* this threshhold is a trade-off knob to choose between
* the potential additional overhead of an extra GET_LBA_STATUS request
* vs. unnecessarily reading a lot of zero sectors over the wire.
* If a read request is greater or equal than ISCSI_CHECKALLOC_THRES
* sectors we check the allocation status of the area covered by the
* request first if the allocationmap indicates that the area might be
* unallocated. */
#define ISCSI_CHECKALLOC_THRES 64

static void
iscsi_bh_cb(void *p)
Expand Down Expand Up @@ -505,7 +513,7 @@ static int coroutine_fn iscsi_co_readv(BlockDriverState *bs,
}

#if defined(LIBISCSI_FEATURE_IOVECTOR)
if (iscsilun->lbprz && nb_sectors > ISCSI_CHECKALLOC_THRES &&
if (iscsilun->lbprz && nb_sectors >= ISCSI_CHECKALLOC_THRES &&
!iscsi_allocationmap_is_allocated(iscsilun, sector_num, nb_sectors)) {
int64_t ret;
int pnum;
Expand Down

0 comments on commit 5917af8

Please sign in to comment.