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 <johal...@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)
 {
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to