aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/rbd.c
diff options
context:
space:
mode:
authorAlex Elder <elder@dreamhost.com>2012-01-24 11:08:36 -0500
committerAlex Elder <elder@dreamhost.com>2012-03-22 11:47:47 -0400
commitee57741c5209154b8ef124bcaa2496da1b69a988 (patch)
tree248a6e7bf259bb849f885f1ff4a82be74ab4913b /drivers/block/rbd.c
parent2107978668de13da484f7abc3f03516494c7fca9 (diff)
rbd: make ceph_parse_options() return a pointer
ceph_parse_options() takes the address of a pointer as an argument and uses it to return the address of an allocated structure if successful. With this interface is not evident at call sites that the pointer is always initialized. Change the interface to return the address instead (or a pointer-coded error code) to make the validity of the returned pointer obvious. Signed-off-by: Alex Elder <elder@dreamhost.com> Signed-off-by: Sage Weil <sage@newdream.net>
Diffstat (limited to 'drivers/block/rbd.c')
-rw-r--r--drivers/block/rbd.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index b9371f0b9532..ed6711e35323 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -371,11 +371,13 @@ static int rbd_get_client(struct rbd_device *rbd_dev, const char *mon_addr,
371 371
372 rbd_opts->notify_timeout = RBD_NOTIFY_TIMEOUT_DEFAULT; 372 rbd_opts->notify_timeout = RBD_NOTIFY_TIMEOUT_DEFAULT;
373 373
374 ret = ceph_parse_options(&opt, options, mon_addr, 374 opt = ceph_parse_options(options, mon_addr,
375 mon_addr + strlen(mon_addr), 375 mon_addr + strlen(mon_addr),
376 parse_rbd_opts_token, rbd_opts); 376 parse_rbd_opts_token, rbd_opts);
377 if (ret < 0) 377 if (IS_ERR(opt)) {
378 ret = PTR_ERR(opt);
378 goto done_err; 379 goto done_err;
380 }
379 381
380 spin_lock(&node_lock); 382 spin_lock(&node_lock);
381 rbdc = __rbd_client_find(opt); 383 rbdc = __rbd_client_find(opt);