svn commit: r329468 - head/sys/compat/linuxkpi/common/include/linux

Hans Petter Selasky hselasky at FreeBSD.org
Sat Feb 17 20:56:36 UTC 2018


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 at 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)
 {


More information about the svn-src-head mailing list