diff options
author | Alex Elder <elder@inktank.com> | 2012-10-26 00:34:41 -0400 |
---|---|---|
committer | Alex Elder <elder@inktank.com> | 2012-10-30 09:34:29 -0400 |
commit | e5c35534042f4b5957a32bba651222c91247beba (patch) | |
tree | 979442169ba45a6d852cbf57f918ce04d20c378d /drivers/block/rbd.c | |
parent | 0ddebc0c6c518ae42c376151e34d9d4b84443ba5 (diff) |
rbd: get rid of snap_name_len
The value returned in the "snap_name_len" argument to
rbd_add_parse_args() is never actually used, so get rid of it.
The snap_name_len recorded in rbd_dev_v2_snap_name() is not
useful either, so get rid of that too.
Signed-off-by: Alex Elder <elder@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
Diffstat (limited to 'drivers/block/rbd.c')
-rw-r--r-- | drivers/block/rbd.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index 68447d83288c..7bd23139b948 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c | |||
@@ -2408,7 +2408,6 @@ static char *rbd_dev_v2_snap_name(struct rbd_device *rbd_dev, u32 which) | |||
2408 | int ret; | 2408 | int ret; |
2409 | void *p; | 2409 | void *p; |
2410 | void *end; | 2410 | void *end; |
2411 | size_t snap_name_len; | ||
2412 | char *snap_name; | 2411 | char *snap_name; |
2413 | 2412 | ||
2414 | size = sizeof (__le32) + RBD_MAX_SNAP_NAME_LEN; | 2413 | size = sizeof (__le32) + RBD_MAX_SNAP_NAME_LEN; |
@@ -2428,9 +2427,7 @@ static char *rbd_dev_v2_snap_name(struct rbd_device *rbd_dev, u32 which) | |||
2428 | 2427 | ||
2429 | p = reply_buf; | 2428 | p = reply_buf; |
2430 | end = (char *) reply_buf + size; | 2429 | end = (char *) reply_buf + size; |
2431 | snap_name_len = 0; | 2430 | snap_name = ceph_extract_encoded_string(&p, end, NULL, GFP_KERNEL); |
2432 | snap_name = ceph_extract_encoded_string(&p, end, &snap_name_len, | ||
2433 | GFP_KERNEL); | ||
2434 | if (IS_ERR(snap_name)) { | 2431 | if (IS_ERR(snap_name)) { |
2435 | ret = PTR_ERR(snap_name); | 2432 | ret = PTR_ERR(snap_name); |
2436 | goto out; | 2433 | goto out; |
@@ -2849,8 +2846,7 @@ static struct ceph_options *rbd_add_parse_args(struct rbd_device *rbd_dev, | |||
2849 | const char *buf, | 2846 | const char *buf, |
2850 | char *options, | 2847 | char *options, |
2851 | size_t options_size, | 2848 | size_t options_size, |
2852 | char **snap_name, | 2849 | char **snap_name) |
2853 | size_t *snap_name_len) | ||
2854 | { | 2850 | { |
2855 | size_t len; | 2851 | size_t len; |
2856 | const char *mon_addrs; | 2852 | const char *mon_addrs; |
@@ -2898,7 +2894,7 @@ static struct ceph_options *rbd_add_parse_args(struct rbd_device *rbd_dev, | |||
2898 | goto out_err; | 2894 | goto out_err; |
2899 | memcpy(*snap_name, buf, len); | 2895 | memcpy(*snap_name, buf, len); |
2900 | *(*snap_name + len) = '\0'; | 2896 | *(*snap_name + len) = '\0'; |
2901 | *snap_name_len = len; | 2897 | |
2902 | /* Initialize all rbd options to the defaults */ | 2898 | /* Initialize all rbd options to the defaults */ |
2903 | 2899 | ||
2904 | rbd_opts.read_only = RBD_READ_ONLY_DEFAULT; | 2900 | rbd_opts.read_only = RBD_READ_ONLY_DEFAULT; |
@@ -3131,7 +3127,6 @@ static ssize_t rbd_add(struct bus_type *bus, | |||
3131 | char *options; | 3127 | char *options; |
3132 | struct rbd_device *rbd_dev = NULL; | 3128 | struct rbd_device *rbd_dev = NULL; |
3133 | char *snap_name; | 3129 | char *snap_name; |
3134 | size_t snap_name_len = 0; | ||
3135 | struct ceph_options *ceph_opts; | 3130 | struct ceph_options *ceph_opts; |
3136 | struct ceph_osd_client *osdc; | 3131 | struct ceph_osd_client *osdc; |
3137 | int rc = -ENOMEM; | 3132 | int rc = -ENOMEM; |
@@ -3154,7 +3149,7 @@ static ssize_t rbd_add(struct bus_type *bus, | |||
3154 | 3149 | ||
3155 | /* parse add command */ | 3150 | /* parse add command */ |
3156 | ceph_opts = rbd_add_parse_args(rbd_dev, buf, options, count, | 3151 | ceph_opts = rbd_add_parse_args(rbd_dev, buf, options, count, |
3157 | &snap_name, &snap_name_len); | 3152 | &snap_name); |
3158 | if (IS_ERR(ceph_opts)) { | 3153 | if (IS_ERR(ceph_opts)) { |
3159 | rc = PTR_ERR(ceph_opts); | 3154 | rc = PTR_ERR(ceph_opts); |
3160 | goto err_out_mem; | 3155 | goto err_out_mem; |