Convert most manual accesses to filedesc->fd_files[] into the appropriate
authorMatthew Dillon <dillon@dragonflybsd.org>
Fri, 19 May 2006 07:33:46 +0000 (07:33 +0000)
committerMatthew Dillon <dillon@dragonflybsd.org>
Fri, 19 May 2006 07:33:46 +0000 (07:33 +0000)
commit228b401dc8841ecde6fe4b281e31686684b29a82
tree443e6bd3737db655b2a381aa581da62fb62b6465
parentfa541be60037a5a3e89dd0e8307f37ae098b4731
Convert most manual accesses to filedesc->fd_files[] into the appropriate
holdfp() call.  Fix a number of places where ops were being executed
on the file pointer without holding a private reference to it (mainly
fo_ioctl(), revoke(), and lseek()).

Create procedures in kern_descrip.c to set and clear descriptor flags
and to handle the bootstrap filedesc for proc0.  Replace manual code
elsewhere with calls to the new procedures.

Move getvnode() to kern_descrip.c.  Remove nsmb_getfp().  Use holdfp()
instead.
17 files changed:
sys/emulation/ibcs2/i386/ibcs2_fcntl.c
sys/emulation/ibcs2/i386/ibcs2_ioctl.c
sys/emulation/linux/linux_file.c
sys/emulation/svr4/svr4_fcntl.c
sys/emulation/svr4/svr4_filio.c
sys/emulation/svr4/svr4_ioctl.c
sys/emulation/svr4/svr4_stream.c
sys/kern/imgact_elf.c
sys/kern/init_main.c
sys/kern/kern_descrip.c
sys/kern/kern_event.c
sys/kern/sys_generic.c
sys/kern/vfs_syscalls.c
sys/netproto/smb/smb_dev.c
sys/sys/filedesc.h
sys/vfs/fdesc/fdesc_vnops.c
sys/vm/vm_mmap.c