diff options
author | phk <phk@FreeBSD.org> | 2004-11-17 08:01:10 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2004-11-17 08:01:10 +0000 |
commit | 313ccfcf9e23e29fc79adcefe9b9e1b52f7643ff (patch) | |
tree | 58ad6e043341e4831c8010d803a24ce8c0b279b1 /sys/kern/sys_generic.c | |
parent | 3dab450860a416318f4975a44933d133725c58bb (diff) | |
download | FreeBSD-src-313ccfcf9e23e29fc79adcefe9b9e1b52f7643ff.zip FreeBSD-src-313ccfcf9e23e29fc79adcefe9b9e1b52f7643ff.tar.gz |
Push Giant down through select and poll.
Don't grab Giant in the upper syscall/wrapper code
NET_LOCK_GIANT in the socket code (sockets/fifos).
mtx_lock(&Giant) in the vnode code.
Devfs grabs Giant if the driver is marked as needing Giant.
Diffstat (limited to 'sys/kern/sys_generic.c')
-rw-r--r-- | sys/kern/sys_generic.c | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/sys/kern/sys_generic.c b/sys/kern/sys_generic.c index 6f2d551..c90ce5c 100644 --- a/sys/kern/sys_generic.c +++ b/sys/kern/sys_generic.c @@ -625,11 +625,7 @@ kern_select(struct thread *td, int nd, fd_set *fd_in, fd_set *fd_ou, if (nd < 0) return (EINVAL); fdp = td->td_proc->p_fd; - /* - * XXX: kern_select() currently requires that we acquire Giant - * even if none of the file descriptors we poll requires Giant. - */ - mtx_lock(&Giant); + FILEDESC_LOCK_FAST(fdp); if (nd > td->td_proc->p_fd->fd_nfiles) @@ -764,7 +760,6 @@ done_nosellock: if (selbits != &s_selbits[0]) free(selbits, M_SELECT); - mtx_unlock(&Giant); return (error); } @@ -838,11 +833,6 @@ poll(td, uap) nfds = uap->nfds; /* - * XXX: poll() currently requires that we acquire Giant even if - * none of the file descriptors we poll requires Giant. - */ - mtx_lock(&Giant); - /* * This is kinda bogus. We have fd limits, but that is not * really related to the size of the pollfd array. Make sure * we let the process use at least FD_SETSIZE entries and at @@ -943,7 +933,6 @@ out: if (ni > sizeof(smallbits)) free(bits, M_TEMP); done2: - mtx_unlock(&Giant); return (error); } |