Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 25 Feb 2018 10:25:48 +0000 (UTC)
From:      Hans Petter Selasky <hselasky@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r329961 - stable/11/sys/compat/linuxkpi/common/include/linux
Message-ID:  <201802251025.w1PAPmKK013007@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: hselasky
Date: Sun Feb 25 10:25:47 2018
New Revision: 329961
URL: https://svnweb.freebsd.org/changeset/base/329961

Log:
  MFC r329468:
  Add support for kref_read() function in the LinuxKPI.
  
  Submitted by:	Johannes Lundberg <johalun0@gmail.com>
  Sponsored by:	Mellanox Technologies

Modified:
  stable/11/sys/compat/linuxkpi/common/include/linux/kref.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/compat/linuxkpi/common/include/linux/kref.h
==============================================================================
--- stable/11/sys/compat/linuxkpi/common/include/linux/kref.h	Sun Feb 25 10:24:59 2018	(r329960)
+++ stable/11/sys/compat/linuxkpi/common/include/linux/kref.h	Sun Feb 25 10:25:47 2018	(r329961)
@@ -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?201802251025.w1PAPmKK013007>