--- zzzz-none-000/linux-2.6.39.4/include/linux/kref.h 2011-08-03 19:43:28.000000000 +0000 +++ puma6-arm-6490-729/linux-2.6.39.4/include/linux/kref.h 2021-11-10 13:23:10.000000000 +0000 @@ -16,6 +16,7 @@ #define _KREF_H_ #include +#include struct kref { atomic_t refcount; @@ -27,4 +28,8 @@ int kref_sub(struct kref *kref, unsigned int count, void (*release) (struct kref *kref)); +static inline int __must_check kref_get_unless_zero(struct kref *kref) +{ + return atomic_add_unless(&kref->refcount, 1, 0); +} #endif /* _KREF_H_ */