diff options
author | phk <phk@FreeBSD.org> | 2004-11-13 11:53:02 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2004-11-13 11:53:02 +0000 |
commit | 216166ee0de39b10ba8e60f4115d65e1251ff29f (patch) | |
tree | 15f70d195895ba0b6c385bc2892b07302db4faaa /sys/kern/sys_generic.c | |
parent | 32d92d3a1a6bf10d16cd48469ec464510bd8ff2f (diff) | |
download | FreeBSD-src-216166ee0de39b10ba8e60f4115d65e1251ff29f.zip FreeBSD-src-216166ee0de39b10ba8e60f4115d65e1251ff29f.tar.gz |
Introduce an alias for FILEDESC_{UN}LOCK() with the suffix _FAST.
Use this in all the places where sleeping with the lock held is not
an issue.
The distinction will become significant once we finalize the exact
lock-type to use for this kind of case.
Diffstat (limited to 'sys/kern/sys_generic.c')
-rw-r--r-- | sys/kern/sys_generic.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/sys/kern/sys_generic.c b/sys/kern/sys_generic.c index d329460..068e997 100644 --- a/sys/kern/sys_generic.c +++ b/sys/kern/sys_generic.c @@ -490,16 +490,16 @@ ioctl(td, uap) fdp = td->td_proc->p_fd; switch (com = uap->com) { case FIONCLEX: - FILEDESC_LOCK(fdp); + FILEDESC_LOCK_FAST(fdp); fdp->fd_ofileflags[uap->fd] &= ~UF_EXCLOSE; - FILEDESC_UNLOCK(fdp); + FILEDESC_UNLOCK_FAST(fdp); fdrop(fp, td); mtx_unlock(&Giant); return (0); case FIOCLEX: - FILEDESC_LOCK(fdp); + FILEDESC_LOCK_FAST(fdp); fdp->fd_ofileflags[uap->fd] |= UF_EXCLOSE; - FILEDESC_UNLOCK(fdp); + FILEDESC_UNLOCK_FAST(fdp); fdrop(fp, td); mtx_unlock(&Giant); return (0); @@ -650,11 +650,11 @@ kern_select(struct thread *td, int nd, fd_set *fd_in, fd_set *fd_ou, * even if none of the file descriptors we poll requires Giant. */ mtx_lock(&Giant); - FILEDESC_LOCK(fdp); + FILEDESC_LOCK_FAST(fdp); if (nd > td->td_proc->p_fd->fd_nfiles) nd = td->td_proc->p_fd->fd_nfiles; /* forgiving; slightly wrong */ - FILEDESC_UNLOCK(fdp); + FILEDESC_UNLOCK_FAST(fdp); /* * Allocate just enough bits for the non-null fd_sets. Use the |