summaryrefslogtreecommitdiffstats
path: root/sys/fs/procfs
diff options
context:
space:
mode:
Diffstat (limited to 'sys/fs/procfs')
-rw-r--r--sys/fs/procfs/procfs_ctl.c32
-rw-r--r--sys/fs/procfs/procfs_status.c6
2 files changed, 19 insertions, 19 deletions
diff --git a/sys/fs/procfs/procfs_ctl.c b/sys/fs/procfs/procfs_ctl.c
index 5d0ce44..1ca2208 100644
--- a/sys/fs/procfs/procfs_ctl.c
+++ b/sys/fs/procfs/procfs_ctl.c
@@ -167,13 +167,13 @@ procfs_control(curp, p, op)
default:
PROCTREE_LOCK(PT_SHARED);
- mtx_enter(&sched_lock, MTX_SPIN);
+ mtx_lock_spin(&sched_lock);
if (!TRACE_WAIT_P(curp, p)) {
- mtx_exit(&sched_lock, MTX_SPIN);
+ mtx_unlock_spin(&sched_lock);
PROCTREE_LOCK(PT_RELEASE);
return (EBUSY);
}
- mtx_exit(&sched_lock, MTX_SPIN);
+ mtx_unlock_spin(&sched_lock);
PROCTREE_LOCK(PT_RELEASE);
}
@@ -252,31 +252,31 @@ procfs_control(curp, p, op)
error = 0;
if (p->p_flag & P_TRACED) {
PROCTREE_LOCK(PT_SHARED);
- mtx_enter(&sched_lock, MTX_SPIN);
+ mtx_lock_spin(&sched_lock);
while (error == 0 &&
(p->p_stat != SSTOP) &&
(p->p_flag & P_TRACED) &&
(p->p_pptr == curp)) {
- mtx_exit(&sched_lock, MTX_SPIN);
+ mtx_unlock_spin(&sched_lock);
PROCTREE_LOCK(PT_RELEASE);
error = tsleep((caddr_t) p,
PWAIT|PCATCH, "procfsx", 0);
PROCTREE_LOCK(PT_SHARED);
- mtx_enter(&sched_lock, MTX_SPIN);
+ mtx_lock_spin(&sched_lock);
}
if (error == 0 && !TRACE_WAIT_P(curp, p))
error = EBUSY;
- mtx_exit(&sched_lock, MTX_SPIN);
+ mtx_unlock_spin(&sched_lock);
PROCTREE_LOCK(PT_RELEASE);
} else {
- mtx_enter(&sched_lock, MTX_SPIN);
+ mtx_lock_spin(&sched_lock);
while (error == 0 && p->p_stat != SSTOP) {
- mtx_exit(&sched_lock, MTX_SPIN);
+ mtx_unlock_spin(&sched_lock);
error = tsleep((caddr_t) p,
PWAIT|PCATCH, "procfs", 0);
- mtx_enter(&sched_lock, MTX_SPIN);
+ mtx_lock_spin(&sched_lock);
}
- mtx_exit(&sched_lock, MTX_SPIN);
+ mtx_unlock_spin(&sched_lock);
}
return (error);
@@ -284,10 +284,10 @@ procfs_control(curp, p, op)
panic("procfs_control");
}
- mtx_enter(&sched_lock, MTX_SPIN);
+ mtx_lock_spin(&sched_lock);
if (p->p_stat == SSTOP)
setrunnable(p);
- mtx_exit(&sched_lock, MTX_SPIN);
+ mtx_unlock_spin(&sched_lock);
return (0);
}
@@ -329,17 +329,17 @@ procfs_doctl(curp, p, pfs, uio)
nm = vfs_findname(signames, msg, xlen);
if (nm) {
PROCTREE_LOCK(PT_SHARED);
- mtx_enter(&sched_lock, MTX_SPIN);
+ mtx_lock_spin(&sched_lock);
if (TRACE_WAIT_P(curp, p)) {
p->p_xstat = nm->nm_val;
#ifdef FIX_SSTEP
FIX_SSTEP(p);
#endif
setrunnable(p);
- mtx_exit(&sched_lock, MTX_SPIN);
+ mtx_unlock_spin(&sched_lock);
PROCTREE_LOCK(PT_RELEASE);
} else {
- mtx_exit(&sched_lock, MTX_SPIN);
+ mtx_unlock_spin(&sched_lock);
PROCTREE_LOCK(PT_RELEASE);
psignal(p, nm->nm_val);
}
diff --git a/sys/fs/procfs/procfs_status.c b/sys/fs/procfs/procfs_status.c
index 813ad60..14c8fb4 100644
--- a/sys/fs/procfs/procfs_status.c
+++ b/sys/fs/procfs/procfs_status.c
@@ -123,12 +123,12 @@ procfs_dostatus(curp, p, pfs, uio)
DOCHECK();
}
- mtx_enter(&sched_lock, MTX_SPIN);
+ mtx_lock_spin(&sched_lock);
if (p->p_sflag & PS_INMEM) {
struct timeval ut, st;
calcru(p, &ut, &st, (struct timeval *) NULL);
- mtx_exit(&sched_lock, MTX_SPIN);
+ mtx_unlock_spin(&sched_lock);
ps += snprintf(ps, psbuf + sizeof(psbuf) - ps,
" %ld,%ld %ld,%ld %ld,%ld",
p->p_stats->p_start.tv_sec,
@@ -136,7 +136,7 @@ procfs_dostatus(curp, p, pfs, uio)
ut.tv_sec, ut.tv_usec,
st.tv_sec, st.tv_usec);
} else {
- mtx_exit(&sched_lock, MTX_SPIN);
+ mtx_unlock_spin(&sched_lock);
ps += snprintf(ps, psbuf + sizeof(psbuf) - ps,
" -1,-1 -1,-1 -1,-1");
}
OpenPOWER on IntegriCloud