We can call ia64_flush_dirty() when the corresponding process is
locked or not. As such, use PROC_LOCKED() to determine which case it is and lock the process when not.
This commit is contained in:
parent
99f233296d
commit
0fbd447b92
@ -1106,7 +1106,7 @@ ia64_flush_dirty(struct thread *td, struct _special *r)
|
|||||||
struct iovec iov;
|
struct iovec iov;
|
||||||
struct uio uio;
|
struct uio uio;
|
||||||
uint64_t bspst, kstk, rnat;
|
uint64_t bspst, kstk, rnat;
|
||||||
int error;
|
int error, locked;
|
||||||
|
|
||||||
if (r->ndirty == 0)
|
if (r->ndirty == 0)
|
||||||
return (0);
|
return (0);
|
||||||
@ -1127,7 +1127,9 @@ ia64_flush_dirty(struct thread *td, struct _special *r)
|
|||||||
r->rnat = (bspst > kstk && (bspst & 0x1ffL) < (kstk & 0x1ffL))
|
r->rnat = (bspst > kstk && (bspst & 0x1ffL) < (kstk & 0x1ffL))
|
||||||
? *(uint64_t*)(kstk | 0x1f8L) : rnat;
|
? *(uint64_t*)(kstk | 0x1f8L) : rnat;
|
||||||
} else {
|
} else {
|
||||||
PHOLD(td->td_proc);
|
locked = PROC_LOCKED(td->td_proc);
|
||||||
|
if (!locked)
|
||||||
|
PHOLD(td->td_proc);
|
||||||
iov.iov_base = (void*)(uintptr_t)kstk;
|
iov.iov_base = (void*)(uintptr_t)kstk;
|
||||||
iov.iov_len = r->ndirty;
|
iov.iov_len = r->ndirty;
|
||||||
uio.uio_iov = &iov;
|
uio.uio_iov = &iov;
|
||||||
@ -1145,7 +1147,8 @@ ia64_flush_dirty(struct thread *td, struct _special *r)
|
|||||||
*/
|
*/
|
||||||
if (uio.uio_resid != 0 && error == 0)
|
if (uio.uio_resid != 0 && error == 0)
|
||||||
error = ENOSPC;
|
error = ENOSPC;
|
||||||
PRELE(td->td_proc);
|
if (!locked)
|
||||||
|
PRELE(td->td_proc);
|
||||||
}
|
}
|
||||||
|
|
||||||
r->bspstore += r->ndirty;
|
r->bspstore += r->ndirty;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user