diff options
author | jhb <jhb@FreeBSD.org> | 2002-04-16 17:11:34 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2002-04-16 17:11:34 +0000 |
commit | dba04cd736d55f53d6db22e89a37b13ba56eb759 (patch) | |
tree | 0dbfaf0504ea8a7e7591f231c8e177a948a68da3 /sys/kern | |
parent | 6cbba0bb0370167bd9f9a0d6ef843373f6b8f1c0 (diff) | |
download | FreeBSD-src-dba04cd736d55f53d6db22e89a37b13ba56eb759.zip FreeBSD-src-dba04cd736d55f53d6db22e89a37b13ba56eb759.tar.gz |
Lock proctree_lock instead of pgrpsess_lock.
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/kern_descrip.c | 6 | ||||
-rw-r--r-- | sys/kern/kern_fork.c | 4 | ||||
-rw-r--r-- | sys/kern/kern_ktrace.c | 8 | ||||
-rw-r--r-- | sys/kern/kern_resource.c | 12 | ||||
-rw-r--r-- | sys/kern/kern_sig.c | 10 | ||||
-rw-r--r-- | sys/kern/vfs_aio.c | 4 | ||||
-rw-r--r-- | sys/kern/vfs_vnops.c | 6 |
7 files changed, 25 insertions, 25 deletions
diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c index 9f017301..136bd61 100644 --- a/sys/kern/kern_descrip.c +++ b/sys/kern/kern_descrip.c @@ -641,7 +641,7 @@ fsetown(pgid, sigiop) sigio->sio_ucred = crhold(curthread->td_ucred); sigio->sio_myref = sigiop; - PGRPSESS_SLOCK(); + sx_slock(&proctree_lock); if (pgid > 0) { proc = pfind(pgid); if (proc == NULL) { @@ -699,14 +699,14 @@ fsetown(pgid, sigiop) sigio->sio_pgrp = pgrp; PGRP_UNLOCK(pgrp); } - PGRPSESS_SUNLOCK(); + sx_sunlock(&proctree_lock); s = splhigh(); *sigiop = sigio; splx(s); return (0); fail: - PGRPSESS_SUNLOCK(); + sx_sunlock(&proctree_lock); crfree(sigio->sio_ucred); FREE(sigio, M_SIGIO); return (ret); diff --git a/sys/kern/kern_fork.c b/sys/kern/kern_fork.c index 138caa0..8c5ccbe 100644 --- a/sys/kern/kern_fork.c +++ b/sys/kern/kern_fork.c @@ -538,7 +538,7 @@ again: FILEDESC_UNLOCK(p1->p_fd); } else fd = fdshare(p1); - PGRPSESS_XLOCK(); + sx_xlock(&proctree_lock); PGRP_LOCK(p1->p_pgrp); PROC_LOCK(p2); p2->p_fd = fd; @@ -573,7 +573,7 @@ again: PROC_UNLOCK(p1); PROC_UNLOCK(p2); PGRP_UNLOCK(p1->p_pgrp); - PGRPSESS_XUNLOCK(); + sx_xunlock(&proctree_lock); /* * Attach the new process to its parent. diff --git a/sys/kern/kern_ktrace.c b/sys/kern/kern_ktrace.c index 20c31c4..5f77011 100644 --- a/sys/kern/kern_ktrace.c +++ b/sys/kern/kern_ktrace.c @@ -357,16 +357,16 @@ ktrace(td, uap) /* * by process group */ - PGRPSESS_SLOCK(); + sx_slock(&proctree_lock); pg = pgfind(-uap->pid); if (pg == NULL) { - PGRPSESS_SUNLOCK(); + sx_sunlock(&proctree_lock); error = ESRCH; goto done; } /* * ktrops() may call vrele(). Lock pg_members - * by the pgrpsess_lock rather than pg_mtx. + * by the proctree_lock rather than pg_mtx. */ PGRP_UNLOCK(pg); LIST_FOREACH(p, &pg->pg_members, p_pglist) @@ -374,7 +374,7 @@ ktrace(td, uap) ret |= ktrsetchildren(td, p, ops, facs, vp); else ret |= ktrops(td, p, ops, facs, vp); - PGRPSESS_SUNLOCK(); + sx_sunlock(&proctree_lock); } else { /* * by pid diff --git a/sys/kern/kern_resource.c b/sys/kern/kern_resource.c index 5a4d2aa..b89ccc0 100644 --- a/sys/kern/kern_resource.c +++ b/sys/kern/kern_resource.c @@ -110,18 +110,18 @@ getpriority(td, uap) case PRIO_PGRP: { register struct pgrp *pg; - PGRPSESS_SLOCK(); + sx_slock(&proctree_lock); if (uap->who == 0) { pg = td->td_proc->p_pgrp; PGRP_LOCK(pg); } else { pg = pgfind(uap->who); if (pg == NULL) { - PGRPSESS_SUNLOCK(); + sx_sunlock(&proctree_lock); break; } } - PGRPSESS_SUNLOCK(); + sx_sunlock(&proctree_lock); LIST_FOREACH(p, &pg->pg_members, p_pglist) { PROC_LOCK(p); if (!p_cansee(td->td_proc, p) && p->p_ksegrp.kg_nice /* XXXKSE */ < low) @@ -200,18 +200,18 @@ setpriority(td, uap) case PRIO_PGRP: { register struct pgrp *pg; - PGRPSESS_SLOCK(); + sx_slock(&proctree_lock); if (uap->who == 0) { pg = curp->p_pgrp; PGRP_LOCK(pg); } else { pg = pgfind(uap->who); if (pg == NULL) { - PGRPSESS_SUNLOCK(); + sx_sunlock(&proctree_lock); break; } } - PGRPSESS_SUNLOCK(); + sx_sunlock(&proctree_lock); LIST_FOREACH(p, &pg->pg_members, p_pglist) { PROC_LOCK(p); if (!p_cansee(td->td_proc, p)) { diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c index f64e0ec..0011039 100644 --- a/sys/kern/kern_sig.c +++ b/sys/kern/kern_sig.c @@ -1019,7 +1019,7 @@ killpg1(td, sig, pgid, all) } sx_sunlock(&allproc_lock); } else { - PGRPSESS_SLOCK(); + sx_slock(&proctree_lock); if (pgid == 0) { /* * zero pgid means send to my process group. @@ -1029,11 +1029,11 @@ killpg1(td, sig, pgid, all) } else { pgrp = pgfind(pgid); if (pgrp == NULL) { - PGRPSESS_SUNLOCK(); + sx_sunlock(&proctree_lock); return (ESRCH); } } - PGRPSESS_SUNLOCK(); + sx_sunlock(&proctree_lock); LIST_FOREACH(p, &pgrp->pg_members, p_pglist) { PROC_LOCK(p); if (p->p_pid <= 1 || p->p_flag & P_SYSTEM) { @@ -1145,9 +1145,9 @@ gsignal(pgid, sig) struct pgrp *pgrp; if (pgid != 0) { - PGRPSESS_SLOCK(); + sx_slock(&proctree_lock); pgrp = pgfind(pgid); - PGRPSESS_SUNLOCK(); + sx_sunlock(&proctree_lock); if (pgrp != NULL) { pgsignal(pgrp, sig, 0); PGRP_UNLOCK(pgrp); diff --git a/sys/kern/vfs_aio.c b/sys/kern/vfs_aio.c index 3488227..a7e630c 100644 --- a/sys/kern/vfs_aio.c +++ b/sys/kern/vfs_aio.c @@ -794,9 +794,9 @@ aio_daemon(void *uproc) MALLOC(newsess, struct session *, sizeof(struct session), M_SESSION, M_WAITOK | M_ZERO); - PGRPSESS_XLOCK(); + sx_xlock(&proctree_lock); enterpgrp(mycp, mycp->p_pid, newpgrp, newsess); - PGRPSESS_XUNLOCK(); + sx_xunlock(&proctree_lock); /* Mark special process type. */ mycp->p_flag |= P_SYSTEM; diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c index f286960..d2d735d 100644 --- a/sys/kern/vfs_vnops.c +++ b/sys/kern/vfs_vnops.c @@ -701,9 +701,9 @@ vn_ioctl(fp, com, data, td) if (error == 0 && com == TIOCSCTTY) { /* Do nothing if reassigning same control tty */ - PGRPSESS_SLOCK(); + sx_slock(&proctree_lock); if (td->td_proc->p_session->s_ttyvp == vp) { - PGRPSESS_SUNLOCK(); + sx_sunlock(&proctree_lock); return (0); } @@ -713,7 +713,7 @@ vn_ioctl(fp, com, data, td) td->td_proc->p_session->s_ttyvp = vp; SESS_UNLOCK(td->td_proc->p_session); - PGRPSESS_SUNLOCK(); + sx_sunlock(&proctree_lock); /* Get rid of reference to old control tty */ if (vpold) |