Date: Sat, 17 Feb 2018 20:56:35 +0000 (UTC) From: Hans Petter Selasky <hselasky@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r329468 - head/sys/compat/linuxkpi/common/include/linux Message-ID: <201802172056.w1HKuZ6t054452@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: hselasky Date: Sat Feb 17 20:56:35 2018 New Revision: 329468 URL: https://svnweb.freebsd.org/changeset/base/329468 Log: Add support for kref_read() function in the LinuxKPI. MFC after: 1 week Submitted by: Johannes Lundberg <johalun0@gmail.com> Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/kref.h Modified: head/sys/compat/linuxkpi/common/include/linux/kref.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/kref.h Sat Feb 17 20:52:54 2018 (r329467) +++ head/sys/compat/linuxkpi/common/include/linux/kref.h Sat Feb 17 20:56:35 2018 (r329468) @@ -52,6 +52,13 @@ kref_init(struct kref *kref) refcount_init(&kref->refcount.counter, 1); } +static inline unsigned int +kref_read(const struct kref *kref) +{ + + return (atomic_read(&kref->refcount)); +} + static inline void kref_get(struct kref *kref) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201802172056.w1HKuZ6t054452>