linux/net/core
David Howells 65f27f3844 WorkStruct: Pass the work_struct pointer instead of context data
Pass the work_struct pointer to the work function rather than context data.
The work function can use container_of() to work out the data.

For the cases where the container of the work_struct may go away the moment the
pending bit is cleared, it is made possible to defer the release of the
structure by deferring the clearing of the pending bit.

To make this work, an extra flag is introduced into the management side of the
work_struct.  This governs auto-release of the structure upon execution.

Ordinarily, the work queue executor would release the work_struct for further
scheduling or deallocation by clearing the pending bit prior to jumping to the
work function.  This means that, unless the driver makes some guarantee itself
that the work_struct won't go away, the work function may not access anything
else in the work_struct or its container lest they be deallocated..  This is a
problem if the auxiliary data is taken away (as done by the last patch).

However, if the pending bit is *not* cleared before jumping to the work
function, then the work function *may* access the work_struct and its container
with no problems.  But then the work function must itself release the
work_struct by calling work_release().

In most cases, automatic release is fine, so this is the default.  Special
initiators exist for the non-auto-release case (ending in _NAR).


Signed-Off-By: David Howells <dhowells@redhat.com>
2006-11-22 14:55:48 +00:00
..
datagram.c [NET]: Replace CHECKSUM_HW by CHECKSUM_PARTIAL/CHECKSUM_COMPLETE 2006-09-22 14:53:53 -07:00
dev_mcast.c [NET]: Remove unnecessary config.h includes from net/ 2006-09-22 14:54:21 -07:00
dev.c [PATCH] rename net_random to random32 2006-10-17 08:18:43 -07:00
dst.c
dv.c
ethtool.c [ETHTOOL]: Remove some entries from non-root command list. 2006-09-28 18:03:12 -07:00
fib_rules.c Remove all inclusions of <linux/config.h> 2006-10-04 03:38:54 -04:00
filter.c [NET]: Fix sk->sk_filter field access 2006-09-22 15:18:47 -07:00
flow.c IPsec: propagate security module errors up from flow_cache_lookup 2006-10-11 23:59:34 -07:00
gen_estimator.c
gen_stats.c
iovec.c
link_watch.c WorkStruct: Pass the work_struct pointer instead of context data 2006-11-22 14:55:48 +00:00
Makefile [NET]: Protocol Independant Policy Routing Rules Framework 2006-09-22 14:53:40 -07:00
neighbour.c [NEIGH]: always use hash_mask under tbl lock 2006-10-04 00:31:01 -07:00
net-sysfs.c [PATCH] WE-21 support (core API) 2006-09-25 16:52:14 -04:00
netevent.c
netpoll.c [NETPOLL]: Compute checksum properly in netpoll_send_udp(). 2006-11-07 15:10:13 -08:00
pktgen.c [PKTGEN]: TCI endianness fixes 2006-11-05 14:11:31 -08:00
request_sock.c
rtnetlink.c [RTNETLINK]: Fix use of wrong skb in do_getlink() 2006-10-12 01:50:30 -07:00
scm.c [NET]: File descriptor loss while receiving SCM_RIGHTS 2006-10-11 23:59:48 -07:00
skbuff.c [NET]: Set truesize in pskb_copy 2006-11-07 15:10:14 -08:00
sock.c [NET]: __alloc_pages() failures reported due to fragmentation 2006-11-05 14:11:32 -08:00
stream.c
sysctl_net_core.c
user_dma.c
utils.c [PATCH] rename net_random to random32 2006-10-17 08:18:43 -07:00
wireless.c [PATCH] wireless: WE-20 compatibility for ESSID and NICKN ioctls 2006-10-19 17:08:19 -04:00