Jonathan Corbet 76398425bb Move FASYNC bit handling to f_op->fasync()
Removing the BKL from FASYNC handling ran into the challenge of keeping the
setting of the FASYNC bit in filp->f_flags atomic with regard to calls to
the underlying fasync() function.  Andi Kleen suggested moving the handling
of that bit into fasync(); this patch does exactly that.  As a result, we
have a couple of internal API changes: fasync() must now manage the FASYNC
bit, and it will be called without the BKL held.

As it happens, every fasync() implementation in the kernel with one
exception calls fasync_helper().  So, if we make fasync_helper() set the
FASYNC bit, we can avoid making any changes to the other fasync()
functions - as long as those functions, themselves, have proper locking.
Most fasync() implementations do nothing but call fasync_helper() - which
has its own lock - so they are easily verified as correct.  The BKL had
already been pushed down into the rest.

The networking code has its own version of fasync_helper(), so that code
has been augmented with explicit FASYNC bit handling.

Cc: Al Viro <viro@ZenIV.linux.org.uk>
Cc: David Miller <davem@davemloft.net>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
2009-03-16 08:32:27 -06:00
..
2007-10-23 13:47:31 -05:00
2006-11-30 04:58:40 +01:00
2006-10-03 22:54:15 +02:00
2006-10-03 22:47:42 +02:00
2007-10-22 08:13:21 -07:00
2009-01-06 14:53:16 -05:00
2008-10-08 19:44:18 -04:00
2006-12-30 10:56:45 -08:00
2008-06-27 09:39:53 +01:00
2007-07-31 15:39:38 -07:00
2007-05-09 08:58:15 +02:00
2008-02-08 09:22:38 -08:00
2008-09-02 19:21:37 -07:00
2008-07-26 12:00:05 -07:00
2009-01-29 18:04:43 -08:00
2008-04-25 11:56:37 -06:00
2006-11-30 04:58:40 +01:00
2006-12-07 08:39:44 -08:00
2009-01-29 16:34:30 +02:00
2007-02-12 09:48:40 -08:00
2008-11-06 15:41:21 -08:00
2008-11-12 17:17:17 -08:00