diff options
author | Alex Elder <elder@dreamhost.com> | 2012-01-24 11:08:36 -0500 |
---|---|---|
committer | Alex Elder <elder@dreamhost.com> | 2012-03-22 11:47:47 -0400 |
commit | ee57741c5209154b8ef124bcaa2496da1b69a988 (patch) | |
tree | 248a6e7bf259bb849f885f1ff4a82be74ab4913b /fs/ceph | |
parent | 2107978668de13da484f7abc3f03516494c7fca9 (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 'fs/ceph')
-rw-r--r-- | fs/ceph/super.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/ceph/super.c b/fs/ceph/super.c index c3da3b32bdde..4fab1fdcfa6a 100644 --- a/fs/ceph/super.c +++ b/fs/ceph/super.c | |||
@@ -334,10 +334,12 @@ static int parse_mount_options(struct ceph_mount_options **pfsopt, | |||
334 | *path += 2; | 334 | *path += 2; |
335 | dout("server path '%s'\n", *path); | 335 | dout("server path '%s'\n", *path); |
336 | 336 | ||
337 | err = ceph_parse_options(popt, options, dev_name, dev_name_end, | 337 | *popt = ceph_parse_options(options, dev_name, dev_name_end, |
338 | parse_fsopt_token, (void *)fsopt); | 338 | parse_fsopt_token, (void *)fsopt); |
339 | if (err) | 339 | if (IS_ERR(*popt)) { |
340 | err = PTR_ERR(*popt); | ||
340 | goto out; | 341 | goto out; |
342 | } | ||
341 | 343 | ||
342 | /* success */ | 344 | /* success */ |
343 | *pfsopt = fsopt; | 345 | *pfsopt = fsopt; |