iscsi_readcapacity10_cb(struct iscsi_context *iscsi, int status,

                        void *command_data, void *opaque)

{

    struct IscsiTask *itask = opaque;

    struct scsi_readcapacity10 *rc10;

    struct scsi_task *task = command_data;



    if (status != 0) {

        error_report("iSCSI: Failed to read capacity of iSCSI lun. %s",

                     iscsi_get_error(iscsi));

        itask->status   = 1;

        itask->complete = 1;

        scsi_free_scsi_task(task);

        return;

    }



    rc10 = scsi_datain_unmarshall(task);

    if (rc10 == NULL) {

        error_report("iSCSI: Failed to unmarshall readcapacity10 data.");

        itask->status   = 1;

        itask->complete = 1;

        scsi_free_scsi_task(task);

        return;

    }



    itask->iscsilun->block_size = rc10->block_size;

    if (rc10->lba == 0) {

        /* blank disk loaded */

        itask->iscsilun->num_blocks = 0;

    } else {

        itask->iscsilun->num_blocks = rc10->lba + 1;

    }

    itask->bs->total_sectors    = itask->iscsilun->num_blocks *

                               itask->iscsilun->block_size / BDRV_SECTOR_SIZE ;



    itask->status   = 0;

    itask->complete = 1;

    scsi_free_scsi_task(task);

}

iscsi_readcapacity10_cb(struct iscsi_context *iscsi, int status,

                        void *command_data, void *opaque)

{

    struct IscsiTask *itask = opaque;

    struct scsi_readcapacity10 *rc10;

    struct scsi_task *task = command_data;



    if (status != 0) {

        error_report("iSCSI: Failed to read capacity of iSCSI lun. %s",

                     iscsi_get_error(iscsi));

        itask->status   = 1;

        itask->complete = 1;

        scsi_free_scsi_task(task);

        return;

    }



    rc10 = scsi_datain_unmarshall(task);

    if (rc10 == NULL) {

        error_report("iSCSI: Failed to unmarshall readcapacity10 data.");

        itask->status   = 1;

        itask->complete = 1;

        scsi_free_scsi_task(task);

        return;

    }



    itask->iscsilun->block_size = rc10->block_size;

    if (rc10->lba == 0) {

        

        itask->iscsilun->num_blocks = 0;

    } else {

        itask->iscsilun->num_blocks = rc10->lba + 1;

    }

    itask->bs->total_sectors    = itask->iscsilun->num_blocks *

                               itask->iscsilun->block_size / BDRV_SECTOR_SIZE ;



    itask->status   = 0;

    itask->complete = 1;

    scsi_free_scsi_task(task);

}

                        void *command_data, void *opaque)     struct IscsiTask *itask = opaque;     struct scsi_task *task = command_data;     if (status != 0) {         error_report("iSCSI: Failed to read capacity of iSCSI lun. %s",                      iscsi_get_error(iscsi));         itask->status   = 1;         itask->complete = 1;         scsi_free_scsi_task(task);         itask->status   = 1;         itask->complete = 1;         scsi_free_scsi_task(task);     itask->bs->total_sectors    = itask->iscsilun->num_blocks *                                itask->iscsilun->block_size / BDRV_SECTOR_SIZE ;     itask->status   = 0;     itask->complete = 1;     scsi_free_scsi_task(task); iscsi_readcapacity10_cb(struct iscsi_context *iscsi, int status,                         void *command_data, void *opaque)     struct IscsiTask *itask = opaque;     struct scsi_readcapacity10 *rc10;     struct scsi_task *task = command_data;     if (status != 0) {         error_report("iSCSI: Failed to read capacity of iSCSI lun. %s",                      iscsi_get_error(iscsi));         itask->status   = 1;         itask->complete = 1;         scsi_free_scsi_task(task);     rc10 = scsi_datain_unmarshall(task);     if (rc10 == NULL) {         error_report("iSCSI: Failed to unmarshall readcapacity10 data.");         itask->status   = 1;         itask->complete = 1;         scsi_free_scsi_task(task);     itask->iscsilun->block_size = rc10->block_size;     if (rc10->lba == 0) {         itask->iscsilun->num_blocks = 0;     } else {         itask->iscsilun->num_blocks = rc10->lba + 1;     itask->bs->total_sectors    = itask->iscsilun->num_blocks *                                itask->iscsilun->block_size / BDRV_SECTOR_SIZE ;     itask->status   = 0;     itask->complete = 1;     scsi_free_scsi_task(task);     struct IscsiTask *itask = opaque;     struct scsi_task *task = command_data;     if (status != 0) {         itask->status   = 1;         itask->complete = 1;         scsi_free_scsi_task(task);         itask->status   = 1;         itask->complete = 1;         scsi_free_scsi_task(task);     scsi_free_scsi_task(task);         itask->complete = 1;     struct IscsiTask *itask = opaque;     if (status != 0) {         itask->status   = 1;         itask->complete = 1;         itask->status   = 1;         itask->complete = 1;                      iscsi_get_error(iscsi));
FUNC_0(struct iscsi_context *VAR_0, int VAR_1,

                        void *VAR_2, void *VAR_3)

{

    struct IscsiTask *VAR_4 = VAR_3;

    struct scsi_readcapacity10 *VAR_5;

    struct scsi_task *VAR_6 = VAR_2;



    if (VAR_1 != 0) {

        error_report("iSCSI: Failed to read capacity of iSCSI lun. %s",

                     iscsi_get_error(VAR_0));

        VAR_4->VAR_1   = 1;

        VAR_4->complete = 1;

        scsi_free_scsi_task(VAR_6);

        return;

    }



    VAR_5 = scsi_datain_unmarshall(VAR_6);

    if (VAR_5 == NULL) {

        error_report("iSCSI: Failed to unmarshall readcapacity10 data.");

        VAR_4->VAR_1   = 1;

        VAR_4->complete = 1;

        scsi_free_scsi_task(VAR_6);

        return;

    }



    VAR_4->iscsilun->block_size = VAR_5->block_size;

    if (VAR_5->lba == 0) {

        

        VAR_4->iscsilun->num_blocks = 0;

    } else {

        VAR_4->iscsilun->num_blocks = VAR_5->lba + 1;

    }

    VAR_4->bs->total_sectors    = VAR_4->iscsilun->num_blocks *

                               VAR_4->iscsilun->block_size / BDRV_SECTOR_SIZE ;



    VAR_4->VAR_1   = 0;

    VAR_4->complete = 1;

    scsi_free_scsi_task(VAR_6);

}

FUNC_0(struct iscsi_context *VAR_0, int VAR_1,
void *VAR_2, void *VAR_3)
{ struct IscsiTask *VAR_4 = VAR_3; struct scsi_readcapacity10 *VAR_5; struct scsi_task *VAR_6 = VAR_2; if (VAR_1 != 0) { error_report("iSCSI: Failed to read capacity of iSCSI lun. %s",
iscsi_get_error(VAR_0)); VAR_4->VAR_1   = 1; VAR_4->complete = 1; scsi_free_scsi_task(VAR_6); return; } VAR_5 = scsi_datain_unmarshall(VAR_6); if (VAR_5 == NULL) { error_report("iSCSI: Failed to unmarshall readcapacity10 data."); VAR_4->VAR_1   = 1; VAR_4->complete = 1; scsi_free_scsi_task(VAR_6); return; } VAR_4->iscsilun->block_size = VAR_5->block_size; if (VAR_5->lba == 0) { VAR_4->iscsilun->num_blocks = 0; } else { VAR_4->iscsilun->num_blocks = VAR_5->lba + 1; } VAR_4->bs->total_sectors    = VAR_4->iscsilun->num_blocks *
VAR_4->iscsilun->block_size / BDRV_SECTOR_SIZE ; VAR_4->VAR_1   = 0; VAR_4->complete = 1; scsi_free_scsi_task(VAR_6); }