diff options
Diffstat (limited to 'include/linux/kref.h')
-rw-r--r-- | include/linux/kref.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/kref.h b/include/linux/kref.h index 9af255ad1e2f..7c88d865f82f 100644 --- a/include/linux/kref.h +++ b/include/linux/kref.h | |||
@@ -35,6 +35,11 @@ static inline void kref_init(struct kref *kref) | |||
35 | atomic_set(&kref->refcount, 1); | 35 | atomic_set(&kref->refcount, 1); |
36 | } | 36 | } |
37 | 37 | ||
38 | static inline int kref_read(const struct kref *kref) | ||
39 | { | ||
40 | return atomic_read(&kref->refcount); | ||
41 | } | ||
42 | |||
38 | /** | 43 | /** |
39 | * kref_get - increment refcount for object. | 44 | * kref_get - increment refcount for object. |
40 | * @kref: object. | 45 | * @kref: object. |