diff options
author | alfred <alfred@FreeBSD.org> | 2002-03-15 08:03:46 +0000 |
---|---|---|
committer | alfred <alfred@FreeBSD.org> | 2002-03-15 08:03:46 +0000 |
commit | b0fd50345a3289e9bb8d558d427d688f80e93c0b (patch) | |
tree | 79b2481021420dbb65f469bde8de9f78a99e15a3 /sys/kern/kern_descrip.c | |
parent | 2609492c806a011026054da1d551410de94ea04c (diff) | |
download | FreeBSD-src-b0fd50345a3289e9bb8d558d427d688f80e93c0b.zip FreeBSD-src-b0fd50345a3289e9bb8d558d427d688f80e93c0b.tar.gz |
Giant pushdown for read/write/pread/pwrite syscalls.
kern/kern_descrip.c:
Aquire Giant in fdrop_locked when file refcount hits zero, this removes
the requirement for the caller to own Giant for the most part.
kern/kern_ktrace.c:
Aquire Giant in ktrgenio, simplifies locking in upper read/write syscalls.
kern/vfs_bio.c:
Aquire Giant in bwillwrite if needed.
kern/sys_generic.c
Giant pushdown, remove Giant for:
read, pread, write and pwrite.
readv and writev aren't done yet because of the possible malloc calls
for iov to uio processing.
kern/sys_socket.c
Grab giant in the socket fo_read/write functions.
kern/vfs_vnops.c
Grab giant in the vnode fo_read/write functions.
Diffstat (limited to 'sys/kern/kern_descrip.c')
-rw-r--r-- | sys/kern/kern_descrip.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c index 5fed676..50bcc3a 100644 --- a/sys/kern/kern_descrip.c +++ b/sys/kern/kern_descrip.c @@ -1716,6 +1716,7 @@ fdrop_locked(fp, td) FILE_UNLOCK(fp); return (0); } + mtx_lock(&Giant); if (fp->f_count < 0) panic("fdrop: count < 0"); if ((fp->f_flag & FHASLOCK) && fp->f_type == DTYPE_VNODE) { @@ -1733,6 +1734,7 @@ fdrop_locked(fp, td) else error = 0; ffree(fp); + mtx_unlock(&Giant); return (error); } |