aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2023-03-02 23:00:03 -0500
committerKent Overstreet <kent.overstreet@linux.dev>2023-03-02 23:00:03 -0500
commitd010a21653d34d80044c5a1d7702802b264a2a6c (patch)
treeab91ba329fa1045b66272d19ae630293a1526678
parentd5b0d0892a9232ad0e5adb9a4c93cecbbfda41e6 (diff)
downloadbcachefs-tools-d010a21653d34d80044c5a1d7702802b264a2a6c.tar.gz
linux shim: hlist_unhashed()
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
-rw-r--r--include/linux/list.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/linux/list.h b/include/linux/list.h
index 9b2aa07d..bdd09efa 100644
--- a/include/linux/list.h
+++ b/include/linux/list.h
@@ -72,6 +72,19 @@ static inline void list_splice_init(struct list_head *list,
#define hlist_add_head(n, h) cds_hlist_add_head(n, h)
#define hlist_del(n) cds_hlist_del(n)
+#define hlist_del_init(n) cds_hlist_del_init(n)
+
+static inline int hlist_unhashed(const struct hlist_node *h)
+{
+ return !h->prev;
+}
+
+static inline void hlist_del_init(struct hlist_node *n)
+{
+ hlist_del(n);
+ n->prev = NULL;
+ n->next = NULL;
+}
#define hlist_entry(ptr, type, member) container_of(ptr,type,member)