Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F156706564
D25942.id75365.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
746 B
Referenced Files
None
Subscribers
None
D25942.id75365.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D25942: linuxkpi: Add kref_put_lock
Attached
Detach File
Event Timeline
Log In to Comment