Find a file
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
bin mdoc(7) police: tidy up. 2002-01-09 13:29:39 +00:00
contrib MFV: NetBSD style document titles (OS/arch). 2002-01-10 18:07:50 +00:00
crypto Fix a coredump bug occurring if ssh-keygen attempts to change the password 2002-01-07 15:55:20 +00:00
etc Unmunge the version preservation code and obfuscate it so CVS won't munge 2002-01-12 23:08:59 +00:00
games Clean up G. B. Shaw quotes: 2002-01-07 13:47:22 +00:00
gnu Now that we have the original BSD man(1)'s ${MACHINE} feature 2002-01-11 15:12:00 +00:00
include Add support for C++. 2002-01-06 19:04:12 +00:00
kerberos5 Install script via SCRIPTS. 2001-12-17 16:52:32 +00:00
kerberosIV Install script via SCRIPTS. 2001-12-17 16:52:32 +00:00
lib Comment out the retrieval of a termination function from %g1. It is 2002-01-13 06:17:19 +00:00
libexec Build the TCP-wrapper helper "daemon" tcpd. This is not much use in 2002-01-12 13:31:30 +00:00
release Rewrite the i386 processor support section. The old one was too 2002-01-11 23:27:46 +00:00
sbin mdoc(7) police: tidy up the markup. 2002-01-10 16:02:23 +00:00
secure Clean up makefiles, and turn on WARNS=2. Take into account the telnet 2001-11-30 21:10:58 +00:00
share Merge some of vt2x0 tc= chain to save 1024 buffer space. 2002-01-13 09:04:37 +00:00
sys SMP Lock struct file, filedesc and the global file list. 2002-01-13 11:58:06 +00:00
tools Remove broken attempt to compile libc's malloc source directly; this 2002-01-02 06:42:34 +00:00
usr.bin Make substitutions in internal macros like $(@F:.o=.c) work. 2002-01-12 10:45:27 +00:00
usr.sbin Remove myself as maintainer, I don't have free time for adduser anymore. 2002-01-13 11:54:48 +00:00
COPYRIGHT Update to add the July 22, 1999 addendum. 1999-09-05 21:33:47 +00:00
Makefile Make it possible to build manpages for the entire source tree. 2001-03-27 08:43:28 +00:00
Makefile.inc1 gnu/libexec has gone so remove it from the most targets. 2001-12-28 11:53:18 +00:00
Makefile.upgrade $Id$ -> $FreeBSD$ 1999-08-28 01:35:59 +00:00
README Slightly improve the description of "crypto". "DES" is a subset of 2000-08-31 17:59:01 +00:00
UPDATING Add info about the /etc/pam.conf -> /etc/pam.d stuff. 2002-01-12 21:27:02 +00:00

This is the top level of the FreeBSD source directory.  This file
was last revised on:
$FreeBSD$

For copyright information, please see the file COPYRIGHT in this
directory (additional copyright information also exists for some
sources in this tree - please see the specific source directories for
more information).

The Makefile in this directory supports a number of targets for
building components (or all) of the FreeBSD source tree, the most
commonly used one being ``world'', which rebuilds and installs
everything in the FreeBSD system from the source tree except the
kernel, the kernel-modules and the contents of /etc.  The
``buildkernel'' and ``installkernel'' targets build and install
the kernel and the modules (see below).  Please see the top of
the Makefile in this directory for more information on the
standard build targets and compile-time flags.

Building a kernel is a somewhat more involved process, documentation
for which can be found at:
   http://www.freebsd.org/handbook/kernelconfig.html
And in the config(8) man page.
Note: If you want to build and install the kernel with the
``buildkernel'' and ``installkernel'' targets, you have to build
world before.  More information is available in the handbook.

The sample kernel configuration files reside in the sys/i386/conf
sub-directory (assuming that you've installed the kernel sources), the
file named GENERIC being the one used to build your initial installation
kernel.  The file NOTES contains entries and documentation for all possible
devices, not just those commonly used.  It is the successor of the ancient
LINT file, but in contrast to LINT, it is not buildable as a kernel but a
pure reference and documentation file.


Source Roadmap:
---------------
bin		System/User commands.

contrib		Packages contributed by 3rd parties.

crypto		Cryptography stuff (see crypto/README).

etc		Template files for /etc

games		Amusements.

gnu		Various commands and libraries under the GNU Public License.
		Please see gnu/COPYING* for more information.

include		System include files.

kerberosIV	Kerberos package.

lib		System libraries.

libexec		System daemons.

release		Release building Makefile & associated tools.

sbin		System commands.

secure		Cryptographic libraries and commands.

share		Shared resources.

sys		Kernel sources.

tools		Utilities for regression testing and miscellaneous tasks.

usr.bin		User commands.

usr.sbin	System administration commands.


For information on synchronizing your source tree with one or more of
the FreeBSD Project's development branches, please see:

  http://www.freebsd.org/handbook/synching.html