1
0
Fork 0
alistair23-linux/drivers
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
..
acorn IRQ: Maintain regs pointer globally rather than passing to IRQ handlers 2006-10-05 15:10:12 +01:00
acpi WorkStruct: Pass the work_struct pointer instead of context data 2006-11-22 14:55:48 +00:00
amba [PATCH] 64bit resource: fix up printks for resources in misc drivers 2006-06-27 09:23:59 -07:00
ata WorkStruct: Pass the work_struct pointer instead of context data 2006-11-22 14:55:48 +00:00
atm [ATM] horizon: read_bia() needs to be __devinit 2006-10-24 16:16:39 -07:00
base [PATCH] move SYS_HYPERVISOR inside the Generic Driver menu 2006-10-28 11:30:55 -07:00
block WorkStruct: Pass the work_struct pointer instead of context data 2006-11-22 14:55:48 +00:00
bluetooth [PATCH] lockdep: annotate DECLARE_WAIT_QUEUE_HEAD 2006-10-30 12:08:40 -08:00
cdrom [PATCH] cdrom: add endianness annotations 2006-10-10 16:15:33 -07:00
char WorkStruct: Pass the work_struct pointer instead of context data 2006-11-22 14:55:48 +00:00
clocksource [PATCH] clocksource: acpi_pm: add another greylist chipset 2006-10-21 13:35:05 -07:00
connector [PATCH] Process Events: Fix biarch compatibility issue. use __u64 timestamp 2006-07-31 13:28:36 -07:00
cpufreq WorkStruct: Pass the work_struct pointer instead of context data 2006-11-22 14:55:48 +00:00
crypto [CRYPTO] padlock: Convert padlock-sha to use crypto_hash 2006-09-21 11:46:22 +10:00
dio
dma [PATCH] drivers/dma trivial annotations 2006-10-10 15:37:21 -07:00
edac [PATCH] edac_mc: fix error handling 2006-11-03 12:27:57 -08:00
eisa [PATCH] EISA: handle sysfs errors 2006-10-11 11:14:25 -07:00
fc4 [SCSI] fc4: Conversion to struct scsi_cmnd in fc4 2006-10-25 15:12:45 -07:00
firmware [PATCH] dell_rbu: fix error check 2006-11-16 11:43:38 -08:00
hwmon hwmon: Fix debug messages in w83781d 2006-10-18 13:03:09 -07:00
i2c [PATCH] scx200_acb: handle PCI errors 2006-11-20 09:42:05 -08:00
ide [PATCH] drivers/ide: stray bracket 2006-11-14 09:09:27 -08:00
ieee1394 [ETH1394]: Fix unaligned accesses. 2006-10-30 15:24:38 -08:00
infiniband IB/ipath: Depend on CONFIG_NET 2006-11-20 13:06:19 -08:00
input WorkStruct: Pass the work_struct pointer instead of context data 2006-11-22 14:55:48 +00:00
isdn [PATCH] fix build error for HISAX_NETJET 2006-11-20 09:42:05 -08:00
leds [PATCH] drivers/led: handle sysfs errors 2006-10-17 08:18:46 -07:00
macintosh [PATCH] powerpc: windfarm shall request it's sub modules 2006-11-15 19:57:12 -08:00
mca [PATCH] drivers/mca: handle sysfs errors 2006-10-11 11:14:25 -07:00
md [PATCH] md: do not freeze md threads for suspend 2006-11-08 18:29:24 -08:00
media [dvb saa7134] Fix missing 'break' for avermedia card case 2006-11-13 09:50:11 -08:00
message [PATCH] lockdep: annotate DECLARE_WAIT_QUEUE_HEAD 2006-10-30 12:08:40 -08:00
mfd IRQ: Maintain regs pointer globally rather than passing to IRQ handlers 2006-10-05 15:10:12 +01:00
misc [PATCH] Fix for LKDTM MEM_SWAPOUT crashpoint 2006-11-06 01:46:23 -08:00
mmc MMC: Do not set unsupported bits in OCR response 2006-11-09 07:23:54 +01:00
mtd [PATCH] silence 'make xmldocs' warning by adding missing description of 'raw' in nand_base.c:1485 2006-10-27 15:34:51 -07:00
net WorkStruct: Pass the work_struct pointer instead of context data 2006-11-22 14:55:48 +00:00
nubus Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
oprofile [PATCH] inode-diet: Eliminate i_blksize from the inode structure 2006-09-27 08:26:18 -07:00
parisc Build fixes for struct pt_regs removal 2006-10-06 20:47:23 -06:00
parport [PATCH] parport: fix compilation failure 2006-11-16 11:43:37 -08:00
pci WorkStruct: Pass the work_struct pointer instead of context data 2006-11-22 14:55:48 +00:00
pcmcia [PATCH] pcmcia: fix 'rmmod pcmcia' with unbound devices 2006-11-20 09:42:05 -08:00
pnp Fix DMA resource allocation in ACPIPnP 2006-10-18 11:36:11 -07:00
rapidio Fix several typos in drivers/ 2006-10-03 22:31:37 +02:00
rtc [PATCH] rtc: fix printk of 64-bit res on 32-bit platform 2006-10-17 08:18:47 -07:00
s390 [S390] cio: Make ccw_device_register() static. 2006-10-27 12:39:33 +02:00
sbus [SPARC]: Fix bus_id[] string overflow. 2006-10-27 01:03:31 -07:00
scsi WorkStruct: Pass the work_struct pointer instead of context data 2006-11-22 14:55:48 +00:00
serial [POWERPC] CPM_UART: Fix non-console initialisation 2006-11-10 21:35:36 +11:00
sh
sn [PATCH] ioc4: Enable build on non-SN2 2006-10-17 08:18:42 -07:00
spi [PATCH] spi section fix 2006-11-03 12:27:58 -08:00
tc [MIPS] Fix DECserial build error by IRQ hander change 2006-10-08 02:38:28 +01:00
telephony [PATCH] drivers/telephony/ixj: fix an array overrun 2006-11-08 18:29:23 -08:00
usb USB: auerswald possible memleak fix 2006-11-16 14:26:12 -08:00
video Fix generic fb_ddc i2c edid probe msg 2006-11-16 22:18:28 -08:00
w1 W1: ioremap balanced with iounmap 2006-11-16 14:30:26 -08:00
zorro Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
Kconfig [PATCH] ioc4: Enable build on non-SN2 2006-10-17 08:18:42 -07:00
Makefile Move libata to drivers/ata. 2006-08-10 07:31:37 -04:00