remarkable-linux/include
Paul Menage e7c5ec9193 cgroups: add css_tryget()
Add css_tryget(), that obtains a counted reference on a CSS.  It is used
in situations where the caller has a "weak" reference to the CSS, i.e.
one that does not protect the cgroup from removal via a reference count,
but would instead be cleaned up by a destroy() callback.

css_tryget() will return true on success, or false if the cgroup is being
removed.

This is similar to Kamezawa Hiroyuki's patch from a week or two ago, but
with the difference that in the event of css_tryget() racing with a
cgroup_rmdir(), css_tryget() will only return false if the cgroup really
does get removed.

This implementation is done by biasing css->refcnt, so that a refcnt of 1
means "releasable" and 0 means "released or releasing".  In the event of a
race, css_tryget() distinguishes between "released" and "releasing" by
checking for the CSS_REMOVED flag in css->flags.

Signed-off-by: Paul Menage <menage@google.com>
Tested-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Li Zefan <lizf@cn.fujitsu.com>
Cc: Balbir Singh <balbir@in.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-01-08 08:31:10 -08:00
..
acpi
asm-arm
asm-frv frv: introduce asm/swab.h 2009-01-06 18:10:28 -08:00
asm-generic remove linux/hardirq.h from asm-generic/local.h 2009-01-06 15:59:13 -08:00
asm-h8300
asm-m32r m32r: introduce asm/swab.h 2009-01-06 18:10:28 -08:00
asm-m68k m68k: introduce asm/swab.h 2009-01-06 18:10:27 -08:00
asm-mn10300 mn10300: introduce asm/swab.h 2009-01-06 18:10:29 -08:00
crypto
drm
keys
linux cgroups: add css_tryget() 2009-01-08 08:31:10 -08:00
math-emu
media
mtd
net wimax: headers for kernel API and user space interaction 2009-01-07 10:00:16 -08:00
pcmcia
rdma
rxrpc
scsi
sound
trace
video
xen xen: add xenfs to allow usermode <-> Xen interaction 2009-01-08 08:30:59 -08:00
Kbuild