mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-11-22 11:14:18 +01:00
virtio_p9fs: Simplify vt9p_req_wait() a bit
Remove an always-false check for whether the request has already completed before sleeping. Even if the request is complete, the response tag is updated while holding the channel lock, which is also held here. No functional change intended. Sponsored by: Klara, Inc.
This commit is contained in:
parent
1f6f247b35
commit
28c9b13b23
@ -110,9 +110,10 @@ SYSCTL_UINT(_vfs_9p, OID_AUTO, ackmaxidle, CTLFLAG_RW, &vt9p_ackmaxidle, 0,
|
|||||||
static int
|
static int
|
||||||
vt9p_req_wait(struct vt9p_softc *chan, struct p9_req_t *req)
|
vt9p_req_wait(struct vt9p_softc *chan, struct p9_req_t *req)
|
||||||
{
|
{
|
||||||
if (req->tc->tag != req->rc->tag) {
|
KASSERT(req->tc->tag != req->rc->tag,
|
||||||
if (msleep(req, VT9P_MTX(chan), 0, "chan lock",
|
("%s: request %p already completed", __func__, req));
|
||||||
vt9p_ackmaxidle * hz)) {
|
|
||||||
|
if (msleep(req, VT9P_MTX(chan), 0, "chan lock", vt9p_ackmaxidle * hz)) {
|
||||||
/*
|
/*
|
||||||
* Waited for 120s. No response from host.
|
* Waited for 120s. No response from host.
|
||||||
* Can't wait for ever..
|
* Can't wait for ever..
|
||||||
@ -122,8 +123,7 @@ vt9p_req_wait(struct vt9p_softc *chan, struct p9_req_t *req)
|
|||||||
return (EIO);
|
return (EIO);
|
||||||
}
|
}
|
||||||
KASSERT(req->tc->tag == req->rc->tag,
|
KASSERT(req->tc->tag == req->rc->tag,
|
||||||
("Spurious event on p9 req"));
|
("%s spurious event on request %p", __func__, req));
|
||||||
}
|
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user