freebsd-dev/sys/netsmb
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
..
netbios.h Spelling fixes. 2001-12-31 19:29:43 +00:00
smb_conn.c
smb_conn.h Spelling fixes. 2001-12-31 19:29:43 +00:00
smb_crypt.c
smb_dev.c SMP Lock struct file, filedesc and the global file list. 2002-01-13 11:58:06 +00:00
smb_dev.h
smb_iod.c
smb_rq.c Spelling fixes. 2001-12-31 19:29:43 +00:00
smb_rq.h Spelling fixes. 2001-12-31 19:29:43 +00:00
smb_smb.c Update to C99, s/__FUNCTION__/__func__/, 2001-12-10 08:09:49 +00:00
smb_subr.c
smb_subr.h Update to C99, s/__FUNCTION__/__func__/, 2001-12-10 08:09:49 +00:00
smb_tran.h
smb_trantcp.c Spelling fixes. 2001-12-31 19:29:43 +00:00
smb_trantcp.h Update to C99, s/__FUNCTION__/__func__/, 2001-12-10 08:09:49 +00:00
smb_usr.c
smb.h Spelling fixes. 2001-12-31 19:29:43 +00:00