All of lore.kernel.org
 help / color / mirror / Atom feed
From: Coly Li <colyli@suse.de>
To: linux-bcache@vger.kernel.org
Cc: linux-block@vger.kernel.org, Coly Li <colyli@suse.de>
Subject: [RFC PATCH v2 01/16] bcache: move definition of 'int ret' out of macro read_bucket()
Date: Sat, 20 Apr 2019 00:04:54 +0800	[thread overview]
Message-ID: <20190419160509.66298-2-colyli@suse.de> (raw)
In-Reply-To: <20190419160509.66298-1-colyli@suse.de>

'int ret' is defined as a local variable inside macro read_bucket().
Since this macro is called multiple times, and following patches will
use a 'int ret' variable in bch_journal_read(), this patch moves
definition of 'int ret' from macro read_bucket() to range of function
bch_journal_read().

Signed-off-by: Coly Li <colyli@suse.de>
---
 drivers/md/bcache/journal.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/md/bcache/journal.c b/drivers/md/bcache/journal.c
index b2fd412715b1..6e18057d1d82 100644
--- a/drivers/md/bcache/journal.c
+++ b/drivers/md/bcache/journal.c
@@ -147,7 +147,7 @@ int bch_journal_read(struct cache_set *c, struct list_head *list)
 {
 #define read_bucket(b)							\
 	({								\
-		int ret = journal_read_bucket(ca, list, b);		\
+		ret = journal_read_bucket(ca, list, b);			\
 		__set_bit(b, bitmap);					\
 		if (ret < 0)						\
 			return ret;					\
@@ -156,6 +156,7 @@ int bch_journal_read(struct cache_set *c, struct list_head *list)
 
 	struct cache *ca;
 	unsigned int iter;
+	int ret = 0;
 
 	for_each_cache(ca, c, iter) {
 		struct journal_device *ja = &ca->journal;
@@ -267,7 +268,7 @@ int bch_journal_read(struct cache_set *c, struct list_head *list)
 					    struct journal_replay,
 					    list)->j.seq;
 
-	return 0;
+	return ret;
 #undef read_bucket
 }
 
-- 
2.16.4


  reply	other threads:[~2019-04-19 18:23 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-19 16:04 [RFC PATCH v2 00/16] bcache: fix journal no-space deadlock Coly Li
2019-04-19 16:04 ` Coly Li [this message]
2019-04-21 17:47   ` [RFC PATCH v2 01/16] bcache: move definition of 'int ret' out of macro read_bucket() Chaitanya Kulkarni
2019-04-22 15:11     ` Coly Li
2019-04-23  6:50   ` Hannes Reinecke
2019-04-19 16:04 ` [RFC PATCH v2 02/16] bcache: never set 0 to KEY_PTRS of jouranl key in journal_reclaim() Coly Li
2019-04-23  6:50   ` Hannes Reinecke
2019-04-19 16:04 ` [RFC PATCH v2 03/16] bcache: reload jouranl key information during journal replay Coly Li
2019-04-23  6:54   ` Hannes Reinecke
2019-04-23  6:56     ` Coly Li
2019-04-19 16:04 ` [RFC PATCH v2 04/16] bcache: fix journal deadlock during jouranl replay Coly Li
2019-04-23  6:59   ` Hannes Reinecke
2019-04-23  7:07     ` Coly Li
2019-04-19 16:04 ` [RFC PATCH v2 05/16] bcache: reserve space for journal_meta() in run time Coly Li
2019-04-23  7:00   ` Hannes Reinecke
2019-04-19 16:04 ` [RFC PATCH v2 06/16] bcache: add failure check to run_cache_set() for journal replay Coly Li
2019-04-23  7:02   ` Hannes Reinecke
2019-04-23  7:09     ` Coly Li
2019-04-24 16:06     ` Coly Li
2019-04-19 16:05 ` [RFC PATCH v2 07/16] bcache: add comments for kobj release callback routine Coly Li
2019-04-21 17:52   ` Chaitanya Kulkarni
2019-04-23  7:03   ` Hannes Reinecke
2019-04-19 16:05 ` [RFC PATCH v2 08/16] bcache: return error immediately in bch_journal_replay() Coly Li
2019-04-23  7:04   ` Hannes Reinecke
2019-04-19 16:05 ` [RFC PATCH v2 09/16] bcache: add error check for calling register_bdev() Coly Li
2019-04-21 18:00   ` Chaitanya Kulkarni
2019-04-23  7:04   ` Hannes Reinecke
2019-04-19 16:05 ` [RFC PATCH v2 10/16] bcache: Add comments for blkdev_put() in registration code path Coly Li
2019-04-21 17:50   ` Chaitanya Kulkarni
2019-04-23  7:05   ` Hannes Reinecke
2019-04-19 16:05 ` [RFC PATCH v2 11/16] bcache: add comments for closure_fn to be called in closure_queue() Coly Li
2019-04-21 17:43   ` Chaitanya Kulkarni
2019-04-23  7:05   ` Hannes Reinecke
2019-04-19 16:05 ` [RFC PATCH v2 12/16] bcache: add pendings_cleanup to stop pending bcache device Coly Li
2019-04-23  7:08   ` Hannes Reinecke
2019-04-23  7:15     ` Coly Li
2019-04-19 16:05 ` [RFC PATCH v2 13/16] bcache: fix fifo index swapping condition in btree_flush_write() Coly Li
     [not found]   ` <20190419231642.90AB82171F@mail.kernel.org>
2019-04-20 13:20     ` Coly Li
2019-04-23  7:09   ` Hannes Reinecke
2019-04-23  7:16     ` Coly Li
2019-04-19 16:05 ` [RFC PATCH v2 14/16] bcache: try to flush btree nodes as many as possible Coly Li
2019-04-23  7:10   ` Hannes Reinecke
2019-04-19 16:05 ` [RFC PATCH v2 15/16] bcache: improve bcache_reboot() Coly Li
2019-04-23  7:13   ` Hannes Reinecke
2019-04-23  7:18     ` Coly Li
2019-04-19 16:05 ` [RFC PATCH v2 16/16] bcache: introduce spinlock_t flush_write_lock in struct journal Coly Li
2019-04-23  7:14   ` Hannes Reinecke

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=20190419160509.66298-2-colyli@suse.de \
    --to=colyli@suse.de \
    --cc=linux-bcache@vger.kernel.org \
    --cc=linux-block@vger.kernel.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.