Skip to content

Commit 6c4ca1e

Browse files
mlyleaxboe
authored andcommitted
bcache: check return value of register_shrinker
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> Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent e393aa2 commit 6c4ca1e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

drivers/md/bcache/btree.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -807,7 +807,10 @@ int bch_btree_cache_alloc(struct cache_set *c)
807807
c->shrink.scan_objects = bch_mca_scan;
808808
c->shrink.seeks = 4;
809809
c->shrink.batch = c->btree_pages * 2;
810-
register_shrinker(&c->shrink);
810+
811+
if (register_shrinker(&c->shrink))
812+
pr_warn("bcache: %s: could not register shrinker",
813+
__func__);
811814

812815
return 0;
813816
}

0 commit comments

Comments
 (0)