summaryrefslogtreecommitdiff
path: root/backport-include/linux/kref.h
blob: 631488f5fdb79f363d15392687a82b96b90ab4fd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
#ifndef __BACKPORT_LINUX_KREF_H
#define __BACKPORT_LINUX_KREF_H
#include_next <linux/kref.h>

#if LINUX_VERSION_IS_LESS(4,11,0)
#include <linux/refcount.h>
static inline unsigned int kref_read(const struct kref *kref)
{
        return refcount_read((const refcount_t *)&kref->refcount);
}
#endif /* < 4.11 */

#endif /* __BACKPORT_LINUX_KREF_H */