[PATCH 2/4] libxfs: add a kfree_rcu_mightsleep stub

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Add a kfree_rcu_mightsleep stub so that code that needs to RCU free
AGs in kernelspace can simply use this helper in xfsprogs.

Signed-off-by: Christoph Hellwig <hch@xxxxxx>
---
 include/kmem.h | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/include/kmem.h b/include/kmem.h
index 8dfb2fb0b..b61385ec4 100644
--- a/include/kmem.h
+++ b/include/kmem.h
@@ -65,6 +65,16 @@ static inline void kfree(const void *ptr)
 	free((void *)ptr);
 }
 
+/*
+ * Stub for the kernel kfree_rcu_mightsleep.  Does not actually wait
+ * for a RCU grace period, so can only be used in code that does not
+ * require RCU protection in userspace.
+ */
+static inline void kfree_rcu_mightsleep(const void *ptr)
+{
+	kfree(ptr);
+}
+
 __attribute__((format(printf,2,3)))
 char *kasprintf(gfp_t gfp, const char *fmt, ...);
 
-- 
2.43.0





[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux