git://scm.lunaixsky.com
/
lunaix-os.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
feat: (ahci) support multiple AHCI controller
[lunaix-os.git]
/
lunaix-os
/
kernel
/
block
/
blkio.c
diff --git
a/lunaix-os/kernel/block/blkio.c
b/lunaix-os/kernel/block/blkio.c
index 44531c4091636ef09309db1e6dc59135b553d767..7cfc354b8d1ddb2ea26174c8d435039d1ab9f645 100644
(file)
--- a/
lunaix-os/kernel/block/blkio.c
+++ b/
lunaix-os/kernel/block/blkio.c
@@
-24,6
+24,7
@@
__blkio_req_create(struct vecbuf* buffer,
.flags = options,
.evt_args = evt_args };
breq->vbuf = buffer;
.flags = options,
.evt_args = evt_args };
breq->vbuf = buffer;
+ waitq_init(&breq->wait);
return breq;
}
return breq;
}
@@
-76,7
+77,7
@@
blkio_commit(struct blkio_context* ctx, struct blkio_req* req)
llist_append(&ctx->queue, &req->reqs);
// if the pipeline is not running (e.g., stalling). Then we should schedule
llist_append(&ctx->queue, &req->reqs);
// if the pipeline is not running (e.g., stalling). Then we should schedule
- // one immediately and kick it start.
+ // one immediately and kick it start
ed
.
if (!ctx->busy) {
blkio_schedule(ctx);
}
if (!ctx->busy) {
blkio_schedule(ctx);
}
@@
-102,9
+103,16
@@
void
blkio_complete(struct blkio_req* req)
{
req->flags &= ~(BLKIO_BUSY | BLKIO_PENDING);
blkio_complete(struct blkio_req* req)
{
req->flags &= ~(BLKIO_BUSY | BLKIO_PENDING);
+
if (req->completed) {
req->completed(req);
}
if (req->completed) {
req->completed(req);
}
+
+ // FIXME Not working in first process! Need a dummy process.
+ // Wake all blocked processes on completion,
+ // albeit should be no more than one process in everycase (by design)
+ pwake_all(&req->wait);
+
if ((req->flags & BLKIO_FOC)) {
blkio_free_req(req);
}
if ((req->flags & BLKIO_FOC)) {
blkio_free_req(req);
}