lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1508268996-8959-1-git-send-email-longman@redhat.com>
Date:   Tue, 17 Oct 2017 15:36:35 -0400
From:   Waiman Long <longman@...hat.com>
To:     Alexander Viro <viro@...iv.linux.org.uk>, Jan Kara <jack@...e.com>,
        Jeff Layton <jlayton@...chiereds.net>,
        "J. Bruce Fields" <bfields@...ldses.org>,
        Tejun Heo <tj@...nel.org>,
        Christoph Lameter <cl@...ux-foundation.org>
Cc:     linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
        Ingo Molnar <mingo@...hat.com>,
        Peter Zijlstra <peterz@...radead.org>,
        Andi Kleen <andi@...stfloor.org>,
        Dave Chinner <dchinner@...hat.com>,
        Boqun Feng <boqun.feng@...il.com>,
        Davidlohr Bueso <dave@...olabs.net>,
        Waiman Long <longman@...hat.com>
Subject: [PATCH v7 8/9] lib/dlock-list: Export symbols and add warnings

The EXPORT_SYMBOL() macro is now used in lib/dlock-list.c to enable
kernel modules to use dlock-list. Some warning messages are also added.

Signed-off-by: Waiman Long <longman@...hat.com>
---
 lib/dlock-list.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/lib/dlock-list.c b/lib/dlock-list.c
index 4fded20..6ce5c7193 100644
--- a/lib/dlock-list.c
+++ b/lib/dlock-list.c
@@ -132,6 +132,7 @@ int alloc_dlock_list_heads(struct dlock_list_heads *dlist, int irqsafe)
 	}
 	return 0;
 }
+EXPORT_SYMBOL(alloc_dlock_list_heads);
 
 /**
  * free_dlock_list_heads - Free all the heads entries of the dlock list
@@ -145,6 +146,7 @@ void free_dlock_list_heads(struct dlock_list_heads *dlist)
 	kfree(dlist->heads);
 	dlist->heads = NULL;
 }
+EXPORT_SYMBOL(free_dlock_list_heads);
 
 /**
  * dlock_lists_empty - Check if all the dlock lists are empty
@@ -159,11 +161,15 @@ bool dlock_lists_empty(struct dlock_list_heads *dlist)
 {
 	int idx;
 
+	/* Shouldn't be called before nr_dlock_lists is initialized */
+	WARN_ON_ONCE(!nr_dlock_lists);
+
 	for (idx = 0; idx < nr_dlock_lists; idx++)
 		if (!list_empty(&dlist->heads[idx].list))
 			return false;
 	return true;
 }
+EXPORT_SYMBOL(dlock_lists_empty);
 
 /**
  * dlock_list_hash - Hash the given context to a particular list
@@ -187,6 +193,7 @@ struct dlock_list_head *dlock_list_hash(struct dlock_list_heads *dlist,
 				% nr_dlock_lists;
 	return &dlist->heads[hash];
 }
+EXPORT_SYMBOL(dlock_list_hash);
 
 /**
  * dlock_list_add - Add a node to a particular head of dlock list
@@ -210,6 +217,7 @@ void dlock_list_add(struct dlock_list_node *node,
 		spin_unlock(&head->lock);
 	}
 }
+EXPORT_SYMBOL(dlock_list_add);
 
 /**
  * dlock_lists_add - Adds a node to the given dlock list
@@ -226,6 +234,7 @@ void dlock_lists_add(struct dlock_list_node *node,
 
 	dlock_list_add(node, head);
 }
+EXPORT_SYMBOL(dlock_lists_add);
 
 /**
  * dlock_lists_del - Delete a node from a dlock list
@@ -273,6 +282,7 @@ void dlock_lists_del(struct dlock_list_node *node)
 			spin_unlock(&head->lock);
 	} while (retry);
 }
+EXPORT_SYMBOL(dlock_lists_del);
 
 /**
  * __dlock_list_next_list: Find the first entry of the next available list
@@ -287,6 +297,9 @@ struct dlock_list_node *__dlock_list_next_list(struct dlock_list_iter *iter)
 	struct dlock_list_node *next;
 	struct dlock_list_head *head;
 
+	/* Shouldn't be called before nr_dlock_lists is initialized */
+	WARN_ON_ONCE(!nr_dlock_lists);
+
 restart:
 	if (iter->entry) {
 		dlock_list_unlock(iter);
@@ -320,3 +333,4 @@ struct dlock_list_node *__dlock_list_next_list(struct dlock_list_iter *iter)
 
 	return next;
 }
+EXPORT_SYMBOL(__dlock_list_next_list);
-- 
1.8.3.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ