]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blame - src/patches/compat-drivers-3.8-1-u-kref_get_unless_zero.patch
asterisk addon: update to 11.13.1
[people/pmueller/ipfire-2.x.git] / src / patches / compat-drivers-3.8-1-u-kref_get_unless_zero.patch
CommitLineData
79f94395
MT
1--- compat-drivers-3.8-1-u/include/linux/compat-3.8.h.orig 2013-05-16 20:35:27.046386772 +0200
2+++ compat-drivers-3.8-1-u/include/linux/compat-3.8.h 2013-05-16 20:35:39.219767618 +0200
3@@ -24,35 +24,6 @@
4
5 /* This backports:
6 *
7- * commit 4b20db3de8dab005b07c74161cb041db8c5ff3a7
8- * Author: Thomas Hellstrom <thellstrom@vmware.com>
9- * Date: Tue Nov 6 11:31:49 2012 +0000
10- *
11- * kref: Implement kref_get_unless_zero v3
12- */
13-/**
14- * kref_get_unless_zero - Increment refcount for object unless it is zero.
15- * @kref: object.
16- *
17- * Return non-zero if the increment succeeded. Otherwise return 0.
18- *
19- * This function is intended to simplify locking around refcounting for
20- * objects that can be looked up from a lookup structure, and which are
21- * removed from that lookup structure in the object destructor.
22- * Operations on such objects require at least a read lock around
23- * lookup + kref_get, and a write lock around kref_put + remove from lookup
24- * structure. Furthermore, RCU implementations become extremely tricky.
25- * With a lookup followed by a kref_get_unless_zero *with return value check*
26- * locking in the kref_put path can be deferred to the actual removal from
27- * the lookup structure and RCU lookups become trivial.
28- */
29-static inline int __must_check kref_get_unless_zero(struct kref *kref)
30-{
31- return atomic_add_unless(&kref->refcount, 1, 0);
32-}
33-
34-/* This backports:
35- *
36 * commit 83e68189745ad931c2afd45d8ee3303929233e7f
37 * Author: Matt Fleming <matt.fleming@intel.com>
38 * Date: Wed Nov 14 09:42:35 2012 +0000