From: Mark Hills <mark-UrrBsZIrrsb10XsdtD+oqA@public.gmane.org>
To: linux-bcache-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: [PATCH 4/7] Don't require linkage against closure_lock
Date: Sat, 10 Sep 2011 14:45:36 +0100 [thread overview]
Message-ID: <1315662339-3115-4-git-send-email-mark@pogo.org.uk> (raw)
In-Reply-To: <1315662339-3115-1-git-send-email-mark-UrrBsZIrrsb10XsdtD+oqA@public.gmane.org>
Allow building as a module with CONFIG_BCACHE_CLOSURE_DEBUG.
Previously bcache.o required access to closure_lock. Instead
of exposing this symbol move the affected function.
---
block/bcache_util.c | 11 +++++++++++
block/bcache_util.h | 17 +----------------
2 files changed, 12 insertions(+), 16 deletions(-)
diff --git a/block/bcache_util.c b/block/bcache_util.c
index 8e147de..19846fb 100644
--- a/block/bcache_util.c
+++ b/block/bcache_util.c
@@ -476,6 +476,17 @@ void closure_sync(struct closure *c)
}
EXPORT_SYMBOL_GPL(closure_sync);
+void closure_del(struct closure *c)
+{
+#ifdef CONFIG_BCACHE_CLOSURE_DEBUG
+ unsigned long flags;
+ spin_lock_irqsave(&closure_lock, flags);
+ list_del(&c->all);
+ spin_unlock_irqrestore(&closure_lock, flags);
+#endif
+}
+EXPORT_SYMBOL_GPL(closure_del);
+
#ifdef CONFIG_BCACHE_CLOSURE_DEBUG
#ifdef CONFIG_DEBUG_FS
diff --git a/block/bcache_util.h b/block/bcache_util.h
index d208131..872ca56 100644
--- a/block/bcache_util.h
+++ b/block/bcache_util.h
@@ -474,22 +474,7 @@ void closure_run_wait(closure_list_t *list, struct workqueue_struct *wq);
bool closure_wait(closure_list_t *list, struct closure *c);
void closure_sync(struct closure *c);
void __closure_sleep(struct closure *c);
-
-#ifdef CONFIG_BCACHE_CLOSURE_DEBUG
-extern struct list_head closures;
-extern spinlock_t closure_lock;
-
-static inline void closure_del(struct closure *c)
-{
- unsigned long flags;
- spin_lock_irqsave(&closure_lock, flags);
- list_del(&c->all);
- spin_unlock_irqrestore(&closure_lock, flags);
-}
-
-#else
-static inline void closure_del(struct closure *c) {}
-#endif
+void closure_del(struct closure *c);
static inline void closure_init(struct closure *c, struct closure *parent)
{
--
1.7.4.4
next prev parent reply other threads:[~2011-09-10 13:45 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-10 13:44 First observations with bcache Mark Hills
[not found] ` <1109101110320.2733-4jfXtw+jRJ582hYKe6nXyg@public.gmane.org>
2011-09-10 13:45 ` [PATCH 1/7] Use exported call to up/down read Mark Hills
[not found] ` <1315662339-3115-1-git-send-email-mark-UrrBsZIrrsb10XsdtD+oqA@public.gmane.org>
2011-09-10 13:45 ` [PATCH 2/7] Provide 64-bit arithmetic functions Mark Hills
2011-09-10 13:45 ` [PATCH 3/7] Break fuzz test to allow building as module Mark Hills
2011-09-10 13:45 ` Mark Hills [this message]
2011-09-10 13:45 ` [PATCH 5/7] Allow closure debugging without CONFIG_DEBUG_FS Mark Hills
2011-09-10 13:45 ` [PATCH 6/7] Temporary fix to pr_latency() Mark Hills
2011-09-10 13:45 ` [PATCH 7/7] Don't require latency_warn_ms from bcache_util.o Mark Hills
2011-09-10 21:39 ` [PATCH 1/7] Use exported call to up/down read Kent Overstreet
2011-09-22 6:13 ` First observations with bcache Kent Overstreet
2011-09-22 23:14 ` Mark Hills
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1315662339-3115-4-git-send-email-mark@pogo.org.uk \
--to=mark-urrbszirrsb10xsdtd+oqa@public.gmane.org \
--cc=linux-bcache-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.