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
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=179173
@ -1106,7 +1106,7 @@ ia64_flush_dirty(struct thread *td, struct _special *r)
|
||||
struct iovec iov;
|
||||
struct uio uio;
|
||||
uint64_t bspst, kstk, rnat;
|
||||
int error;
|
||||
int error, locked;
|
||||
|
||||
if (r->ndirty == 0)
|
||||
return (0);
|
||||
@ -1127,7 +1127,9 @@ ia64_flush_dirty(struct thread *td, struct _special *r)
|
||||
r->rnat = (bspst > kstk && (bspst & 0x1ffL) < (kstk & 0x1ffL))
|
||||
? *(uint64_t*)(kstk | 0x1f8L) : rnat;
|
||||
} 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_len = r->ndirty;
|
||||
uio.uio_iov = &iov;
|
||||
@ -1145,7 +1147,8 @@ ia64_flush_dirty(struct thread *td, struct _special *r)
|
||||
*/
|
||||
if (uio.uio_resid != 0 && error == 0)
|
||||
error = ENOSPC;
|
||||
PRELE(td->td_proc);
|
||||
if (!locked)
|
||||
PRELE(td->td_proc);
|
||||
}
|
||||
|
||||
r->bspstore += r->ndirty;
|
||||
|
Loading…
Reference in New Issue
Block a user