summaryrefslogtreecommitdiffstats
path: root/sys/compat/svr4/svr4_ttold.c
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2005-09-28 07:03:03 +0000
committerrwatson <rwatson@FreeBSD.org>2005-09-28 07:03:03 +0000
commit2b01dbdaa07af097e72d1ab008447ee1f3b6bd9b (patch)
tree1db6d3398cfd694fad4465d775adf0700c4ab355 /sys/compat/svr4/svr4_ttold.c
parentf47ed80aec8394ebed798d91b1c91773c2139312 (diff)
downloadFreeBSD-src-2b01dbdaa07af097e72d1ab008447ee1f3b6bd9b.zip
FreeBSD-src-2b01dbdaa07af097e72d1ab008447ee1f3b6bd9b.tar.gz
Back out alpha/alpha/trap.c:1.124, osf1_ioctl.c:1.14, osf1_misc.c:1.57,
osf1_signal.c:1.41, amd64/amd64/trap.c:1.291, linux_socket.c:1.60, svr4_fcntl.c:1.36, svr4_ioctl.c:1.23, svr4_ipc.c:1.18, svr4_misc.c:1.81, svr4_signal.c:1.34, svr4_stat.c:1.21, svr4_stream.c:1.55, svr4_termios.c:1.13, svr4_ttold.c:1.15, svr4_util.h:1.10, ext2_alloc.c:1.43, i386/i386/trap.c:1.279, vm86.c:1.58, unaligned.c:1.12, imgact_elf.c:1.164, ffs_alloc.c:1.133: Now that Giant is acquired in uprintf() and tprintf(), the caller no longer leads to acquire Giant unless it also holds another mutex that would generate a lock order reversal when calling into these functions. Specifically not backed out is the acquisition of Giant in nfs_socket.c and rpcclnt.c, where local mutexes are held and would otherwise violate the lock order with Giant. This aligns this code more with the eventual locking of ttys. Suggested by: bde
Diffstat (limited to 'sys/compat/svr4/svr4_ttold.c')
-rw-r--r--sys/compat/svr4/svr4_ttold.c24
1 files changed, 0 insertions, 24 deletions
diff --git a/sys/compat/svr4/svr4_ttold.c b/sys/compat/svr4/svr4_ttold.c
index 537f88a..3575607 100644
--- a/sys/compat/svr4/svr4_ttold.c
+++ b/sys/compat/svr4/svr4_ttold.c
@@ -32,8 +32,6 @@ __FBSDID("$FreeBSD$");
#ifndef BURN_BRIDGES
#include <sys/param.h>
-#include <sys/lock.h>
-#include <sys/mutex.h>
#include <sys/proc.h>
#include <sys/systm.h>
#include <sys/file.h>
@@ -71,8 +69,6 @@ print_svr4_sgttyb(str, ss)
struct svr4_sgttyb *ss;
{
- GIANT_REQUIRED;
-
uprintf("%s\nispeed=%o ospeed=%o ", str, ss->sg_ispeed, ss->sg_ospeed);
uprintf("erase=%o kill=%o flags=%o\n", ss->sg_erase, ss->sg_kill,
ss->sg_flags);
@@ -83,9 +79,6 @@ print_svr4_tchars(str, st)
const char *str;
struct svr4_tchars *st;
{
-
- GIANT_REQUIRED;
-
uprintf("%s\nintrc=%o quitc=%o ", str, st->t_intrc, st->t_quitc);
uprintf("startc=%o stopc=%o eofc=%o brkc=%o\n", st->t_startc,
st->t_stopc, st->t_eofc, st->t_brkc);
@@ -96,9 +89,6 @@ print_svr4_ltchars(str, sl)
const char *str;
struct svr4_ltchars *sl;
{
-
- GIANT_REQUIRED;
-
uprintf("%s\nsuspc=%o dsuspc=%o ", str, sl->t_suspc, sl->t_dsuspc);
uprintf("rprntc=%o flushc=%o werasc=%o lnextc=%o\n", sl->t_rprntc,
sl->t_flushc, sl->t_werasc, sl->t_lnextc);
@@ -241,9 +231,7 @@ svr4_ttold_ioctl(fp, td, retval, fd, cmd, data)
return copyout(&pid, data, sizeof(pid));
#else
- mtx_lock(&Giant);
uprintf("ioctl(TIOCGSID) for pid %d unsupported\n", td->td_proc->p_pid);
- mtx_unlock(&Giant);
return EINVAL;
#endif
}
@@ -260,9 +248,7 @@ svr4_ttold_ioctl(fp, td, retval, fd, cmd, data)
bsd_sgttyb_to_svr4_sgttyb(&bs, &ss);
#ifdef DEBUG_SVR4
- mtx_lock(&Giant);
print_svr4_sgttyb("SVR4_TIOCGETP", &ss);
- mtx_unlock(&Giant);
#endif /* DEBUG_SVR4 */
return copyout(&ss, data, sizeof(ss));
}
@@ -278,9 +264,7 @@ svr4_ttold_ioctl(fp, td, retval, fd, cmd, data)
svr4_sgttyb_to_bsd_sgttyb(&ss, &bs);
#ifdef DEBUG_SVR4
- mtx_lock(&Giant);
print_svr4_sgttyb("SVR4_TIOCSET{P,N}", &ss);
- mtx_unlock(&Giant);
#endif /* DEBUG_SVR4 */
cmd = (cmd == SVR4_TIOCSETP) ? TIOCSETP : TIOCSETN;
return fo_ioctl(fp, cmd, (caddr_t) &bs,
@@ -299,9 +283,7 @@ svr4_ttold_ioctl(fp, td, retval, fd, cmd, data)
bsd_tchars_to_svr4_tchars(&bt, &st);
#ifdef DEBUG_SVR4
- mtx_lock(&Giant);
print_svr4_tchars("SVR4_TIOCGETC", &st);
- mtx_unlock(&Giant);
#endif /* DEBUG_SVR4 */
return copyout(&st, data, sizeof(st));
}
@@ -316,9 +298,7 @@ svr4_ttold_ioctl(fp, td, retval, fd, cmd, data)
svr4_tchars_to_bsd_tchars(&st, &bt);
#ifdef DEBUG_SVR4
- mtx_lock(&Giant);
print_svr4_tchars("SVR4_TIOCSETC", &st);
- mtx_unlock(&Giant);
#endif /* DEBUG_SVR4 */
return fo_ioctl(fp, TIOCSETC, (caddr_t) &bt,
td->td_ucred, td);
@@ -336,9 +316,7 @@ svr4_ttold_ioctl(fp, td, retval, fd, cmd, data)
bsd_ltchars_to_svr4_ltchars(&bl, &sl);
#ifdef DEBUG_SVR4
- mtx_lock(&Giant);
print_svr4_ltchars("SVR4_TIOCGLTC", &sl);
- mtx_unlock(&Giant);
#endif /* DEBUG_SVR4 */
return copyout(&sl, data, sizeof(sl));
}
@@ -353,9 +331,7 @@ svr4_ttold_ioctl(fp, td, retval, fd, cmd, data)
svr4_ltchars_to_bsd_ltchars(&sl, &bl);
#ifdef DEBUG_SVR4
- mtx_lock(&Giant);
print_svr4_ltchars("SVR4_TIOCSLTC", &sl);
- mtx_unlock(&Giant);
#endif /* DEBUG_SVR4 */
return fo_ioctl(fp, TIOCSLTC, (caddr_t) &bl,
td->td_ucred, td);
OpenPOWER on IntegriCloud