public inbox for linux-bcache@vger.kernel.org
 help / color / mirror / Atom feed
From: Michael Lyle <mlyle@lyle.org>
To: linux-bcache@vger.kernel.org, linux-block@vger.kernel.org
Cc: axboe@kernel.dk, Michael Lyle <mlyle@lyle.org>
Subject: [PATCH 4/4] bcache: check return value of register_shrinker
Date: Fri, 24 Nov 2017 15:14:27 -0800	[thread overview]
Message-ID: <20171124231427.9563-5-mlyle@lyle.org> (raw)
In-Reply-To: <20171124231427.9563-1-mlyle@lyle.org>

register_shrinker is now __must_check, so check it to kill a warning.
Caller of bch_btree_cache_alloc in super.c appropriately checks return
value so this is fully plumbed through.

This V2 fixes checkpatch warnings and improves the commit description,
as I was too hasty getting the previous version out.

Signed-off-by: Michael Lyle <mlyle@lyle.org>
Reviewed-by: Vojtech Pavlik <vojtech@suse.com>
---
 drivers/md/bcache/btree.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/md/bcache/btree.c b/drivers/md/bcache/btree.c
index 11c5503d31dc..81e8dc3dbe5e 100644
--- a/drivers/md/bcache/btree.c
+++ b/drivers/md/bcache/btree.c
@@ -807,7 +807,10 @@ int bch_btree_cache_alloc(struct cache_set *c)
 	c->shrink.scan_objects = bch_mca_scan;
 	c->shrink.seeks = 4;
 	c->shrink.batch = c->btree_pages * 2;
-	register_shrinker(&c->shrink);
+
+	if (register_shrinker(&c->shrink))
+		pr_warn("bcache: %s: could not register shrinker",
+				__func__);
 
 	return 0;
 }
-- 
2.14.1

  parent reply	other threads:[~2017-11-24 23:14 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-24 23:14 Commits for 4.15-- bcache Michael Lyle
2017-11-24 23:14 ` [PATCH 1/4] bcache: add a comment in journal bucket reading Michael Lyle
2017-11-24 23:14 ` [PATCH 2/4] bcache: Fix building error on MIPS Michael Lyle
2017-11-28 13:42   ` Christoph Hellwig
2017-11-24 23:14 ` [PATCH 3/4] bcache: recover data from backing when data is clean Michael Lyle
2017-11-24 23:14 ` Michael Lyle [this message]
2017-11-24 23:23 ` Commits for 4.15-- bcache Jens Axboe

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=20171124231427.9563-5-mlyle@lyle.org \
    --to=mlyle@lyle.org \
    --cc=axboe@kernel.dk \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox