static int iscsi_aio_discard_acb(IscsiAIOCB *acb) {

    struct iscsi_context *iscsi = acb->iscsilun->iscsi;

    struct unmap_list list[1];



    acb->canceled   = 0;

    acb->bh         = NULL;

    acb->status     = -EINPROGRESS;

    acb->buf        = NULL;



    list[0].lba = sector_qemu2lun(acb->sector_num, acb->iscsilun);

    list[0].num = acb->nb_sectors * BDRV_SECTOR_SIZE / acb->iscsilun->block_size;



    acb->task = iscsi_unmap_task(iscsi, acb->iscsilun->lun,

                                 0, 0, &list[0], 1,

                                 iscsi_unmap_cb,

                                 acb);

    if (acb->task == NULL) {

        error_report("iSCSI: Failed to send unmap command. %s",

                     iscsi_get_error(iscsi));

        return -1;

    }



    return 0;

}

static int iscsi_aio_discard_acb(IscsiAIOCB *acb) {

    struct iscsi_context *iscsi = acb->iscsilun->iscsi;

    struct unmap_list list[1];



    acb->canceled   = 0;

    acb->bh         = NULL;

    acb->status     = -EINPROGRESS;

    acb->buf        = NULL;



    list[0].lba = sector_qemu2lun(acb->sector_num, acb->iscsilun);

    list[0].num = acb->nb_sectors * BDRV_SECTOR_SIZE / acb->iscsilun->block_size;



    acb->task = iscsi_unmap_task(iscsi, acb->iscsilun->lun,

                                 0, 0, &list[0], 1,

                                 iscsi_unmap_cb,

                                 acb);

    if (acb->task == NULL) {

        error_report("iSCSI: Failed to send unmap command. %s",

                     iscsi_get_error(iscsi));

        return -1;

    }



    return 0;

}

static int FUNC_0(IscsiAIOCB *VAR_0) {

    struct iscsi_context *VAR_1 = VAR_0->iscsilun->VAR_1;

    struct unmap_list VAR_2[1];



    VAR_0->canceled   = 0;

    VAR_0->bh         = NULL;

    VAR_0->status     = -EINPROGRESS;

    VAR_0->buf        = NULL;



    VAR_2[0].lba = sector_qemu2lun(VAR_0->sector_num, VAR_0->iscsilun);

    VAR_2[0].num = VAR_0->nb_sectors * BDRV_SECTOR_SIZE / VAR_0->iscsilun->block_size;



    VAR_0->task = iscsi_unmap_task(VAR_1, VAR_0->iscsilun->lun,

                                 0, 0, &VAR_2[0], 1,

                                 iscsi_unmap_cb,

                                 VAR_0);

    if (VAR_0->task == NULL) {

        error_report("iSCSI: Failed to send unmap command. %s",

                     iscsi_get_error(VAR_1));

        return -1;

    }



    return 0;

}

static int FUNC_0(IscsiAIOCB *VAR_0) { struct iscsi_context *VAR_1 = VAR_0->iscsilun->VAR_1; struct unmap_list VAR_2[1]; VAR_0->canceled   = 0; VAR_0->bh         = NULL; VAR_0->status     = -EINPROGRESS; VAR_0->buf        = NULL; VAR_2[0].lba = sector_qemu2lun(VAR_0->sector_num, VAR_0->iscsilun); VAR_2[0].num = VAR_0->nb_sectors * BDRV_SECTOR_SIZE / VAR_0->iscsilun->block_size; VAR_0->task = iscsi_unmap_task(VAR_1, VAR_0->iscsilun->lun,
0, 0, &VAR_2[0], 1,
iscsi_unmap_cb,
VAR_0); if (VAR_0->task == NULL) { error_report("iSCSI: Failed to send unmap command. %s",
iscsi_get_error(VAR_1)); return -1; } return 0; }