void aio_bh_schedule_oneshot(AioContext *ctx, QEMUBHFunc *cb, void *opaque)

{

    QEMUBH *bh;

    bh = g_new(QEMUBH, 1);

    *bh = (QEMUBH){

        .ctx = ctx,

        .cb = cb,

        .opaque = opaque,

    };

    qemu_lockcnt_lock(&ctx->list_lock);

    bh->next = ctx->first_bh;

    bh->scheduled = 1;

    bh->deleted = 1;

    /* Make sure that the members are ready before putting bh into list */

    smp_wmb();

    ctx->first_bh = bh;

    qemu_lockcnt_unlock(&ctx->list_lock);

    aio_notify(ctx);

}

void aio_bh_schedule_oneshot(AioContext *ctx, QEMUBHFunc *cb, void *opaque)

{

    QEMUBH *bh;

    bh = g_new(QEMUBH, 1);

    *bh = (QEMUBH){

        .ctx = ctx,

        .cb = cb,

        .opaque = opaque,

    };

    qemu_lockcnt_lock(&ctx->list_lock);

    bh->next = ctx->first_bh;

    bh->scheduled = 1;

    bh->deleted = 1;

    

    smp_wmb();

    ctx->first_bh = bh;

    qemu_lockcnt_unlock(&ctx->list_lock);

    aio_notify(ctx);

}

void FUNC_0(AioContext *VAR_0, QEMUBHFunc *VAR_1, void *VAR_2)

{

    QEMUBH *bh;

    bh = g_new(QEMUBH, 1);

    *bh = (QEMUBH){

        .VAR_0 = VAR_0,

        .VAR_1 = VAR_1,

        .VAR_2 = VAR_2,

    };

    qemu_lockcnt_lock(&VAR_0->list_lock);

    bh->next = VAR_0->first_bh;

    bh->scheduled = 1;

    bh->deleted = 1;

    

    smp_wmb();

    VAR_0->first_bh = bh;

    qemu_lockcnt_unlock(&VAR_0->list_lock);

    aio_notify(VAR_0);

}

void FUNC_0(AioContext *VAR_0, QEMUBHFunc *VAR_1, void *VAR_2)
{ QEMUBH *bh; bh = g_new(QEMUBH, 1); *bh = (QEMUBH){ .VAR_0 = VAR_0,
.VAR_1 = VAR_1,
.VAR_2 = VAR_2,
}; qemu_lockcnt_lock(&VAR_0->list_lock); bh->next = VAR_0->first_bh; bh->scheduled = 1; bh->deleted = 1; smp_wmb(); VAR_0->first_bh = bh; qemu_lockcnt_unlock(&VAR_0->list_lock); aio_notify(VAR_0); }