freebsd-src/sys/netgraph
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
..
netgraph.h Add an external function to unlink a netgraph type from the types list. 2001-07-23 21:14:57 +00:00
ng_async.c Update to C99, s/__FUNCTION__/__func__/, 2001-12-10 08:09:49 +00:00
ng_async.h Since neither archie nor I work at Whistle any more, change our email 2000-10-24 17:32:45 +00:00
ng_base.c Update to C99, s/__FUNCTION__/__func__/, 2001-12-10 08:09:49 +00:00
ng_bpf.c Update to C99, s/__FUNCTION__/__func__/, 2001-12-10 08:09:49 +00:00
ng_bpf.h Fix cut and paste error in a comment. 2001-01-30 07:58:30 +00:00
ng_bridge.c Typo. 2001-12-15 20:53:15 +00:00
ng_bridge.h New netgraph node type for Ethernet bridging. 2000-09-01 01:37:13 +00:00
ng_cisco.c log routine called w/ %ld and int argument, cast argument to long 2001-10-29 02:22:49 +00:00
ng_cisco.h Since neither archie nor I work at Whistle any more, change our email 2000-10-24 17:32:45 +00:00
ng_echo.c Part 2 of the netgraph rewrite. 2001-01-08 05:34:06 +00:00
ng_echo.h Since neither archie nor I work at Whistle any more, change our email 2000-10-24 17:32:45 +00:00
ng_eiface.c Update to C99, s/__FUNCTION__/__func__/, 2001-12-10 08:09:49 +00:00
ng_eiface.h slight cleanups during testing. 2001-02-25 16:49:04 +00:00
ng_etf.c A node that allows ethernet type packets to be filtered to different 2001-10-30 07:28:17 +00:00
ng_etf.h A node that allows ethernet type packets to be filtered to different 2001-10-30 07:28:17 +00:00
ng_ether.c Update to C99, s/__FUNCTION__/__func__/, 2001-12-10 08:09:49 +00:00
ng_ether.h Since neither archie nor I work at Whistle any more, change our email 2000-10-24 17:32:45 +00:00
ng_frame_relay.c Update to C99, s/__FUNCTION__/__func__/, 2001-12-10 08:09:49 +00:00
ng_frame_relay.h Since neither archie nor I work at Whistle any more, change our email 2000-10-24 17:32:45 +00:00
ng_gif.c Update to C99, s/__FUNCTION__/__func__/, 2001-12-10 08:09:49 +00:00
ng_gif.h Fixed pedantic syntax error (trailing semicolon in enum). 2001-10-04 07:51:42 +00:00
ng_gif_demux.c Update to C99, s/__FUNCTION__/__func__/, 2001-12-10 08:09:49 +00:00
ng_gif_demux.h The initial commit contained an error in the license, this is the 2001-09-27 00:04:29 +00:00
ng_hole.c Part 2 of the netgraph rewrite. 2001-01-08 05:34:06 +00:00
ng_hole.h Since neither archie nor I work at Whistle any more, change our email 2000-10-24 17:32:45 +00:00
ng_iface.c Update to C99, s/__FUNCTION__/__func__/, 2001-12-10 08:09:49 +00:00
ng_iface.h Since neither archie nor I work at Whistle any more, change our email 2000-10-24 17:32:45 +00:00
ng_ip_input.c Add ng_ip_input. A new netgraph node for queuing IP packets into the 2001-09-27 21:54:27 +00:00
ng_ip_input.h Add ng_ip_input. A new netgraph node for queuing IP packets into the 2001-09-27 21:54:27 +00:00
ng_ksocket.c Avoid reentrantly sending on the same socket, which causes a kernel panic. 2002-01-06 01:08:30 +00:00
ng_ksocket.h When a socket is not connected, allow the peer "struct sockaddr" 2001-11-28 19:39:58 +00:00
ng_lmi.c Fix some memory leaks 2001-01-10 07:13:58 +00:00
ng_lmi.h Since neither archie nor I work at Whistle any more, change our email 2000-10-24 17:32:45 +00:00
ng_message.h Clean up reference counting with relation to queued packets and the worklist, 2001-02-01 20:51:23 +00:00
ng_mppc.c Add support for 56 bit MPPE encryption. 2001-12-15 02:07:32 +00:00
ng_mppc.h Add support for 56 bit MPPE encryption. 2001-12-15 02:07:32 +00:00
ng_one2many.c Update to C99, s/__FUNCTION__/__func__/, 2001-12-10 08:09:49 +00:00
ng_one2many.h Add a new distribution algorythm to the 'one2many' node type. 2001-01-28 15:37:06 +00:00
ng_parse.c Update to C99, s/__FUNCTION__/__func__/, 2001-12-10 08:09:49 +00:00
ng_parse.h Go back to using data_len in struct ngpppoe_init_data after discussions 2000-11-16 23:14:53 +00:00
ng_ppp.c Update to C99, s/__FUNCTION__/__func__/, 2001-12-10 08:09:49 +00:00
ng_ppp.h More complete fix for multi-link sequence number handling bugs. 2000-10-06 23:42:02 +00:00
ng_pppoe.c Update to C99, s/__FUNCTION__/__func__/, 2001-12-10 08:09:49 +00:00
ng_pppoe.h Shuffle sysctls a bit (thankyou whoever made them dynamic for modules) 2001-02-23 16:34:22 +00:00
ng_pptpgre.c Update to C99, s/__FUNCTION__/__func__/, 2001-12-10 08:09:49 +00:00
ng_pptpgre.h Since neither archie nor I work at Whistle any more, change our email 2000-10-24 17:32:45 +00:00
ng_rfc1490.c Update to C99, s/__FUNCTION__/__func__/, 2001-12-10 08:09:49 +00:00
ng_rfc1490.h Since neither archie nor I work at Whistle any more, change our email 2000-10-24 17:32:45 +00:00
ng_sample.c Make the sample netgraph node compileable again. 2001-02-25 05:36:25 +00:00
ng_sample.h Since neither archie nor I work at Whistle any more, change our email 2000-10-24 17:32:45 +00:00
ng_socket.c SMP Lock struct file, filedesc and the global file list. 2002-01-13 11:58:06 +00:00
ng_socket.h Since neither archie nor I work at Whistle any more, change our email 2000-10-24 17:32:45 +00:00
ng_socketvar.h Since neither archie nor I work at Whistle any more, change our email 2000-10-24 17:32:45 +00:00
ng_split.c Update to C99, s/__FUNCTION__/__func__/, 2001-12-10 08:09:49 +00:00
ng_split.h General cleanup providing better style(9) conformance and generally 2001-07-24 23:33:06 +00:00
ng_tee.c Update to C99, s/__FUNCTION__/__func__/, 2001-12-10 08:09:49 +00:00
ng_tee.h Since neither archie nor I work at Whistle any more, change our email 2000-10-24 17:32:45 +00:00
ng_tty.c Update to C99, s/__FUNCTION__/__func__/, 2001-12-10 08:09:49 +00:00
ng_tty.h Since neither archie nor I work at Whistle any more, change our email 2000-10-24 17:32:45 +00:00
ng_UI.c Update to C99, s/__FUNCTION__/__func__/, 2001-12-10 08:09:49 +00:00
ng_UI.h Since neither archie nor I work at Whistle any more, change our email 2000-10-24 17:32:45 +00:00
ng_vjc.c Update to C99, s/__FUNCTION__/__func__/, 2001-12-10 08:09:49 +00:00
ng_vjc.h Since neither archie nor I work at Whistle any more, change our email 2000-10-24 17:32:45 +00:00
NOTES Rewrite of netgraph to start getting ready for SMP. 2001-01-06 00:46:47 +00:00