llist: add interface to check if a node is on a list.
authorNeilBrown <neilb@suse.de>
Mon, 11 Sep 2023 14:39:24 +0000 (10:39 -0400)
committerChuck Lever <chuck.lever@oracle.com>
Mon, 16 Oct 2023 16:44:05 +0000 (12:44 -0400)
commitd6b3358a2813bb14791259a2227d9af1e7019ca0
treedfcd414323d726a8c90daa0913e467402f93b592
parent2b65a226840c0e86db0e7926856a0a017b3390f2
llist: add interface to check if a node is on a list.

With list.h lists, it is easy to test if a node is on a list, providing
it was initialised and that it is removed with list_del_init().

This patch provides similar functionality for llist.h lists.

 init_llist_node()
marks a node as being not-on-any-list be setting the ->next pointer to
the node itself.
 llist_on_list()
tests if the node is on any list.
 llist_del_first_init()
remove the first element from a llist, and marks it as being off-list.

Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
include/linux/llist.h