summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIlya Dryomov <ilya.dryomov@inktank.com>2013-12-13 15:28:57 +0200
committerIlya Dryomov <ilya.dryomov@inktank.com>2013-12-31 20:31:55 +0200
commite1b4d96dea61c3078775090e8b121f571aab8fda (patch)
tree9e37bd2aab0ab5b339862046602c9359d827e4d8
parent90da258b887538ed3a2f904fa593173f26a1adbc (diff)
downloadlinux-e1b4d96dea61c3078775090e8b121f571aab8fda.tar.bz2
rbd: refactor rbd_init() a bit
Refactor rbd_init() a bit to make it more clear what's going on. Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com> Reviewed-by: Alex Elder <elder@linaro.org> Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
-rw-r--r--drivers/block/rbd.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index d743900ca780..8b78a08483a6 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -5292,18 +5292,22 @@ static int __init rbd_init(void)
if (!libceph_compatible(NULL)) {
rbd_warn(NULL, "libceph incompatibility (quitting)");
-
return -EINVAL;
}
+
rc = rbd_slab_init();
if (rc)
return rc;
+
rc = rbd_sysfs_init();
if (rc)
- rbd_slab_exit();
- else
- pr_info("loaded\n");
+ goto err_out_slab;
+ pr_info("loaded\n");
+ return 0;
+
+err_out_slab:
+ rbd_slab_exit();
return rc;
}