From b1d5d64a7cf48415da13b5e1848eb117af4a2086 Mon Sep 17 00:00:00 2001 From: Vladislav Bolkhovitin Date: Thu, 3 Oct 2013 04:24:25 +0000 Subject: [PATCH] Add list_entry_in_list() git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5017 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/include/scst.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/scst/include/scst.h b/scst/include/scst.h index 1b23824b9..7a2c38847 100644 --- a/scst/include/scst.h +++ b/scst/include/scst.h @@ -174,6 +174,15 @@ static inline unsigned int queue_max_hw_sectors(struct request_queue *q) #define __list_for_each list_for_each #endif +/* + * Returns true if entry is in its list. Entry must be deleted from the + * list by using list_del_init()! + */ +static inline bool list_entry_in_list(const struct list_head *entry) +{ + return !list_empty(entry); +} + #define SCST_INTERFACE_VERSION \ SCST_VERSION_STRING "$Revision$" SCST_CONST_VERSION