static void scsi_dma_complete_noio(SCSIDiskReq *r, int ret)

{

    assert(r->req.aiocb == NULL);



    if (r->req.io_canceled) {

        scsi_req_cancel_complete(&r->req);

        goto done;

    }



    if (ret < 0) {

        if (scsi_handle_rw_error(r, -ret, false)) {

            goto done;

        }

    }



    r->sector += r->sector_count;

    r->sector_count = 0;

    if (r->req.cmd.mode == SCSI_XFER_TO_DEV) {

        scsi_write_do_fua(r);

        return;

    } else {

        scsi_req_complete(&r->req, GOOD);

    }



done:

    scsi_req_unref(&r->req);

}

static void scsi_dma_complete_noio(SCSIDiskReq *r, int ret)

{

    assert(r->req.aiocb == NULL);



    if (r->req.io_canceled) {

        scsi_req_cancel_complete(&r->req);

        goto done;

    }



    if (ret < 0) {

        if (scsi_handle_rw_error(r, -ret, false)) {

            goto done;

        }

    }



    r->sector += r->sector_count;

    r->sector_count = 0;

    if (r->req.cmd.mode == SCSI_XFER_TO_DEV) {

        scsi_write_do_fua(r);

        return;

    } else {

        scsi_req_complete(&r->req, GOOD);

    }



done:

    scsi_req_unref(&r->req);

}

static void FUNC_0(SCSIDiskReq *VAR_0, int VAR_1)

{

    assert(VAR_0->req.aiocb == NULL);



    if (VAR_0->req.io_canceled) {

        scsi_req_cancel_complete(&VAR_0->req);

        goto done;

    }



    if (VAR_1 < 0) {

        if (scsi_handle_rw_error(VAR_0, -VAR_1, false)) {

            goto done;

        }

    }



    VAR_0->sector += VAR_0->sector_count;

    VAR_0->sector_count = 0;

    if (VAR_0->req.cmd.mode == SCSI_XFER_TO_DEV) {

        scsi_write_do_fua(VAR_0);

        return;

    } else {

        scsi_req_complete(&VAR_0->req, GOOD);

    }



done:

    scsi_req_unref(&VAR_0->req);

}

static void FUNC_0(SCSIDiskReq *VAR_0, int VAR_1)
{ assert(VAR_0->req.aiocb == NULL); if (VAR_0->req.io_canceled) { scsi_req_cancel_complete(&VAR_0->req); goto done; } if (VAR_1 < 0) { if (scsi_handle_rw_error(VAR_0, -VAR_1, false)) { goto done; } } VAR_0->sector += VAR_0->sector_count; VAR_0->sector_count = 0; if (VAR_0->req.cmd.mode == SCSI_XFER_TO_DEV) { scsi_write_do_fua(VAR_0); return; } else { scsi_req_complete(&VAR_0->req, GOOD); } done:
scsi_req_unref(&VAR_0->req); }