linux/net/sunrpc
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
..
auth_gss [PATCH] net/sunrpc/auth_gss/svcauth_gss.c endianness regression 2006-10-10 15:37:24 -07:00
Makefile [PATCH] RPC: introduce client-side transport switch 2005-09-23 12:38:12 -04:00
auth.c [SUNRPC]: trivial endianness annotations 2006-09-28 18:01:21 -07:00
auth_null.c [SUNRPC]: trivial endianness annotations 2006-09-28 18:01:21 -07:00
auth_unix.c [SUNRPC]: trivial endianness annotations 2006-09-28 18:01:21 -07:00
cache.c WorkStruct: Pass the work_struct pointer instead of context data 2006-11-22 14:55:48 +00:00
clnt.c [PATCH] namespaces: utsname: switch to using uts namespaces 2006-10-02 07:57:21 -07:00
pmap_clnt.c [PATCH] SUNRPC: fix race in in-kernel RPC portmapper client 2006-10-20 10:26:39 -07:00
rpc_pipe.c WorkStruct: Pass the work_struct pointer instead of context data 2006-11-22 14:55:48 +00:00
sched.c WorkStruct: Pass the work_struct pointer instead of context data 2006-11-22 14:55:48 +00:00
socklib.c [NET]: Replace CHECKSUM_HW by CHECKSUM_PARTIAL/CHECKSUM_COMPLETE 2006-09-22 14:53:53 -07:00
stats.c [NET]: Conversions from kmalloc+memset to k(z|c)alloc. 2006-07-21 14:51:30 -07:00
sunrpc_syms.c [PATCH] knfsd: add svc_set_num_threads 2006-10-02 07:57:19 -07:00
svc.c [PATCH] knfsd: Allow lockd to drop replies as appropriate 2006-10-17 08:18:46 -07:00
svcauth.c [PATCH] sunrpc: add missing spin_unlock 2006-11-06 01:46:23 -08:00
svcauth_unix.c [PATCH] knfsd: knfsd: cache ipmap per TCP socket 2006-10-04 07:55:16 -07:00
svcsock.c [PATCH] fix "sunrpc: fix refcounting problems in rpc servers" 2006-10-30 12:12:21 -08:00
sysctl.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
timer.c SUNRPC: remove extraneous header inclusions 2006-09-22 23:24:47 -04:00
xdr.c [SUNRPC]: trivial endianness annotations 2006-09-28 18:01:21 -07:00
xprt.c WorkStruct: Pass the work_struct pointer instead of context data 2006-11-22 14:55:48 +00:00
xprtsock.c WorkStruct: Pass the work_struct pointer instead of context data 2006-11-22 14:55:48 +00:00