static void ide_flush_cb(void *opaque, int ret)

{

    IDEState *s = opaque;



    s->pio_aiocb = NULL;



    if (ret == -ECANCELED) {

        return;

    }

    if (ret < 0) {

        /* XXX: What sector number to set here? */

        if (ide_handle_rw_error(s, -ret, IDE_RETRY_FLUSH)) {

            return;

        }

    }



    if (s->bs) {

        block_acct_done(bdrv_get_stats(s->bs), &s->acct);

    }

    s->status = READY_STAT | SEEK_STAT;

    ide_cmd_done(s);

    ide_set_irq(s->bus);

}

static void ide_flush_cb(void *opaque, int ret)

{

    IDEState *s = opaque;



    s->pio_aiocb = NULL;



    if (ret == -ECANCELED) {

        return;

    }

    if (ret < 0) {

        

        if (ide_handle_rw_error(s, -ret, IDE_RETRY_FLUSH)) {

            return;

        }

    }



    if (s->bs) {

        block_acct_done(bdrv_get_stats(s->bs), &s->acct);

    }

    s->status = READY_STAT | SEEK_STAT;

    ide_cmd_done(s);

    ide_set_irq(s->bus);

}

static void FUNC_0(void *VAR_0, int VAR_1)

{

    IDEState *s = VAR_0;



    s->pio_aiocb = NULL;



    if (VAR_1 == -ECANCELED) {

        return;

    }

    if (VAR_1 < 0) {

        

        if (ide_handle_rw_error(s, -VAR_1, IDE_RETRY_FLUSH)) {

            return;

        }

    }



    if (s->bs) {

        block_acct_done(bdrv_get_stats(s->bs), &s->acct);

    }

    s->status = READY_STAT | SEEK_STAT;

    ide_cmd_done(s);

    ide_set_irq(s->bus);

}

static void FUNC_0(void *VAR_0, int VAR_1)
{ IDEState *s = VAR_0; s->pio_aiocb = NULL; if (VAR_1 == -ECANCELED) { return; } if (VAR_1 < 0) { if (ide_handle_rw_error(s, -VAR_1, IDE_RETRY_FLUSH)) { return; } } if (s->bs) { block_acct_done(bdrv_get_stats(s->bs), &s->acct); } s->status = READY_STAT | SEEK_STAT; ide_cmd_done(s); ide_set_irq(s->bus); }