freebsd-skq/sys/compat/svr4
Alfred Perlstein 426da3bcfb SMP Lock struct file, filedesc and the global file list.
Seigo Tanimura (tanimura) posted the initial delta.

I've polished it quite a bit reducing the need for locking and
adapting it for KSE.

Locks:

1 mutex in each filedesc
   protects all the fields.
   protects "struct file" initialization, while a struct file
     is being changed from &badfileops -> &pipeops or something
     the filedesc should be locked.

1 mutex in each struct file
   protects the refcount fields.
   doesn't protect anything else.
   the flags used for garbage collection have been moved to
     f_gcflag which was the FILLER short, this doesn't need
     locking because the garbage collection is a single threaded
     container.
  could likely be made to use a pool mutex.

1 sx lock for the global filelist.

struct file *	fhold(struct file *fp);
        /* increments reference count on a file */

struct file *	fhold_locked(struct file *fp);
        /* like fhold but expects file to locked */

struct file *	ffind_hold(struct thread *, int fd);
        /* finds the struct file in thread, adds one reference and
                returns it unlocked */

struct file *	ffind_lock(struct thread *, int fd);
        /* ffind_hold, but returns file locked */

I still have to smp-safe the fget cruft, I'll get to that asap.
2002-01-13 11:58:06 +00:00
..
imgact_svr4.c Make MAXTSIZ, DFLDSIZ, MAXDSIZ, DFLSSIZ, MAXSSIZ, SGROWSIZ loader 2001-10-10 23:06:54 +00:00
Makefile Fix typo. 2001-09-13 22:02:48 +00:00
svr4_acl.h
svr4_dirent.h
svr4_errno.h
svr4_exec.h KSE Milestone 2 2001-09-12 08:38:13 +00:00
svr4_fcntl.c SMP Lock struct file, filedesc and the global file list. 2002-01-13 11:58:06 +00:00
svr4_fcntl.h Cleanup after repo copy of sys/svr4 to sys/compat/svr4. 2000-08-31 22:54:09 +00:00
svr4_filio.c SMP Lock struct file, filedesc and the global file list. 2002-01-13 11:58:06 +00:00
svr4_filio.h
svr4_fuser.h Cleanup after repo copy of sys/svr4 to sys/compat/svr4. 2000-08-31 22:54:09 +00:00
svr4_hrt.h
svr4_ioctl.c SMP Lock struct file, filedesc and the global file list. 2002-01-13 11:58:06 +00:00
svr4_ioctl.h KSE Milestone 2 2001-09-12 08:38:13 +00:00
svr4_ipc.c FreeBSD doesn't have p_emuldata, and our stackgap_init() doesn't take an 2001-01-23 21:02:44 +00:00
svr4_ipc.h
svr4_misc.c SMP Lock struct file, filedesc and the global file list. 2002-01-13 11:58:06 +00:00
svr4_mman.h
svr4_proto.h KSE Milestone 2 2001-09-12 08:38:13 +00:00
svr4_resource.c Add missing includes of sys/lock.h. 2001-10-11 17:52:20 +00:00
svr4_resource.h
svr4_siginfo.h
svr4_signal.c KSE Milestone 2 2001-09-12 08:38:13 +00:00
svr4_signal.h Make MINSIGSTKSZ machine dependent, and have the sigaltstack 2000-11-09 08:25:48 +00:00
svr4_socket.c KSE Milestone 2 2001-09-12 08:38:13 +00:00
svr4_socket.h KSE Milestone 2 2001-09-12 08:38:13 +00:00
svr4_sockio.c KSE Milestone 2 2001-09-12 08:38:13 +00:00
svr4_sockio.h
svr4_sockmod.h
svr4_stat.c KSE Milestone 2 2001-09-12 08:38:13 +00:00
svr4_stat.h Cleanup after repo copy of sys/svr4 to sys/compat/svr4. 2000-08-31 22:54:09 +00:00
svr4_statvfs.h
svr4_stream.c SMP Lock struct file, filedesc and the global file list. 2002-01-13 11:58:06 +00:00
svr4_stropts.h
svr4_syscall.h KSE Milestone 2 2001-09-12 08:38:13 +00:00
svr4_syscallnames.c KSE Milestone 2 2001-09-12 08:38:13 +00:00
svr4_sysconfig.h
svr4_sysent.c KSE Milestone 2 2001-09-12 08:38:13 +00:00
svr4_systeminfo.h
svr4_sysvec.c KSE Milestone 2 2001-09-12 08:38:13 +00:00
svr4_termios.c KSE Milestone 2 2001-09-12 08:38:13 +00:00
svr4_termios.h
svr4_time.h
svr4_timod.h
svr4_ttold.c KSE Milestone 2 2001-09-12 08:38:13 +00:00
svr4_ttold.h
svr4_types.h
svr4_ucontext.h
svr4_ulimit.h
svr4_ustat.h Cleanup after repo copy of sys/svr4 to sys/compat/svr4. 2000-08-31 22:54:09 +00:00
svr4_util.h KSE Milestone 2 2001-09-12 08:38:13 +00:00
svr4_utsname.h Cleanup after repo copy of sys/svr4 to sys/compat/svr4. 2000-08-31 22:54:09 +00:00
svr4_wait.h
svr4.h Removed bogus include of opt_global.h. opt_global.h is automatically 2000-01-09 12:29:45 +00:00
syscalls.conf
syscalls.master Synchronize syscalls.master(s) with recent Giant pushdown work 2001-09-01 19:36:48 +00:00