Page MenuHomeFreeBSD

D25942.id75365.diff
No OneTemporary

D25942.id75365.diff

Index: head/sys/compat/linuxkpi/common/include/linux/kref.h
===================================================================
--- head/sys/compat/linuxkpi/common/include/linux/kref.h
+++ head/sys/compat/linuxkpi/common/include/linux/kref.h
@@ -38,6 +38,7 @@
#include <linux/compiler.h>
#include <linux/kernel.h>
#include <linux/mutex.h>
+#include <linux/refcount.h>
#include <asm/atomic.h>
@@ -76,6 +77,20 @@
}
return 0;
}
+
+static inline int
+kref_put_lock(struct kref *kref, void (*rel)(struct kref *kref),
+ spinlock_t *lock)
+{
+
+ if (refcount_release(&kref->refcount.counter)) {
+ spin_lock(lock);
+ rel(kref);
+ return (1);
+ }
+ return (0);
+}
+
static inline int
kref_sub(struct kref *kref, unsigned int count,

File Metadata

Mime Type
text/plain
Expires
Sat, May 16, 7:38 PM (3 h, 50 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
33147910
Default Alt Text
D25942.id75365.diff (746 B)

Event Timeline