void scsi_req_unref(SCSIRequest *req)

{

    assert(req->refcount > 0);

    if (--req->refcount == 0) {

        BusState *qbus = req->dev->qdev.parent_bus;

        SCSIBus *bus = DO_UPCAST(SCSIBus, qbus, qbus);



        if (bus->info->free_request && req->hba_private) {

            bus->info->free_request(bus, req->hba_private);

        }

        if (req->ops->free_req) {

            req->ops->free_req(req);

        }

        object_unref(OBJECT(req->dev));

        object_unref(OBJECT(qbus->parent));

        g_free(req);

    }

}

void scsi_req_unref(SCSIRequest *req)

{

    assert(req->refcount > 0);

    if (--req->refcount == 0) {

        BusState *qbus = req->dev->qdev.parent_bus;

        SCSIBus *bus = DO_UPCAST(SCSIBus, qbus, qbus);



        if (bus->info->free_request && req->hba_private) {

            bus->info->free_request(bus, req->hba_private);

        }

        if (req->ops->free_req) {

            req->ops->free_req(req);

        }

        object_unref(OBJECT(req->dev));

        object_unref(OBJECT(qbus->parent));

        g_free(req);

    }

}

        g_free(req);
void FUNC_0(SCSIRequest *VAR_0)

{

    assert(VAR_0->refcount > 0);

    if (--VAR_0->refcount == 0) {

        BusState *qbus = VAR_0->dev->qdev.parent_bus;

        SCSIBus *bus = DO_UPCAST(SCSIBus, qbus, qbus);



        if (bus->info->free_request && VAR_0->hba_private) {

            bus->info->free_request(bus, VAR_0->hba_private);

        }

        if (VAR_0->ops->free_req) {

            VAR_0->ops->free_req(VAR_0);

        }

        object_unref(OBJECT(VAR_0->dev));

        object_unref(OBJECT(qbus->parent));

        g_free(VAR_0);

    }

}

void FUNC_0(SCSIRequest *VAR_0)
{ assert(VAR_0->refcount > 0); if (--VAR_0->refcount == 0) { BusState *qbus = VAR_0->dev->qdev.parent_bus; SCSIBus *bus = DO_UPCAST(SCSIBus, qbus, qbus); if (bus->info->free_request && VAR_0->hba_private) { bus->info->free_request(bus, VAR_0->hba_private); } if (VAR_0->ops->free_req) { VAR_0->ops->free_req(VAR_0); } object_unref(OBJECT(VAR_0->dev)); object_unref(OBJECT(qbus->parent)); g_free(VAR_0); } }