diff options
author | Alex Elder <elder@dreamhost.com> | 2012-11-01 09:39:26 -0400 |
---|---|---|
committer | Alex Elder <elder@inktank.com> | 2013-01-17 15:08:54 -0500 |
commit | 979ed480a2722ad8d9f87054635158f652a1241e (patch) | |
tree | ed46273e517a80678dc88ba3d9cb4268f30f6de5 /drivers/block | |
parent | 69e7a02f633ba7de0aefa87f3f0e3b31e953b09a (diff) |
rbd: kill rbd_spec->image_id_len
There is no real benefit to keeping the length of an image id, so
get rid of it.
Signed-off-by: Alex Elder <elder@inktank.com>
Reviewed-by: David Zafman <david.zafman@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
Diffstat (limited to 'drivers/block')
-rw-r--r-- | drivers/block/rbd.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index a002984891d7..e01dbb12ad03 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c | |||
@@ -145,7 +145,6 @@ struct rbd_spec { | |||
145 | char *pool_name; | 145 | char *pool_name; |
146 | 146 | ||
147 | char *image_id; | 147 | char *image_id; |
148 | size_t image_id_len; | ||
149 | char *image_name; | 148 | char *image_name; |
150 | 149 | ||
151 | u64 snap_id; | 150 | u64 snap_id; |
@@ -2492,7 +2491,6 @@ static int rbd_dev_v2_parent_info(struct rbd_device *rbd_dev) | |||
2492 | void *end; | 2491 | void *end; |
2493 | char *image_id; | 2492 | char *image_id; |
2494 | u64 overlap; | 2493 | u64 overlap; |
2495 | size_t len = 0; | ||
2496 | int ret; | 2494 | int ret; |
2497 | 2495 | ||
2498 | parent_spec = rbd_spec_alloc(); | 2496 | parent_spec = rbd_spec_alloc(); |
@@ -2526,13 +2524,12 @@ static int rbd_dev_v2_parent_info(struct rbd_device *rbd_dev) | |||
2526 | if (parent_spec->pool_id == CEPH_NOPOOL) | 2524 | if (parent_spec->pool_id == CEPH_NOPOOL) |
2527 | goto out; /* No parent? No problem. */ | 2525 | goto out; /* No parent? No problem. */ |
2528 | 2526 | ||
2529 | image_id = ceph_extract_encoded_string(&p, end, &len, GFP_KERNEL); | 2527 | image_id = ceph_extract_encoded_string(&p, end, NULL, GFP_KERNEL); |
2530 | if (IS_ERR(image_id)) { | 2528 | if (IS_ERR(image_id)) { |
2531 | ret = PTR_ERR(image_id); | 2529 | ret = PTR_ERR(image_id); |
2532 | goto out_err; | 2530 | goto out_err; |
2533 | } | 2531 | } |
2534 | parent_spec->image_id = image_id; | 2532 | parent_spec->image_id = image_id; |
2535 | parent_spec->image_id_len = len; | ||
2536 | ceph_decode_64_safe(&p, end, parent_spec->snap_id, out_err); | 2533 | ceph_decode_64_safe(&p, end, parent_spec->snap_id, out_err); |
2537 | ceph_decode_64_safe(&p, end, overlap, out_err); | 2534 | ceph_decode_64_safe(&p, end, overlap, out_err); |
2538 | 2535 | ||
@@ -3368,8 +3365,7 @@ static int rbd_dev_image_id(struct rbd_device *rbd_dev) | |||
3368 | p = response; | 3365 | p = response; |
3369 | rbd_dev->spec->image_id = ceph_extract_encoded_string(&p, | 3366 | rbd_dev->spec->image_id = ceph_extract_encoded_string(&p, |
3370 | p + RBD_IMAGE_ID_LEN_MAX, | 3367 | p + RBD_IMAGE_ID_LEN_MAX, |
3371 | &rbd_dev->spec->image_id_len, | 3368 | NULL, GFP_NOIO); |
3372 | GFP_NOIO); | ||
3373 | if (IS_ERR(rbd_dev->spec->image_id)) { | 3369 | if (IS_ERR(rbd_dev->spec->image_id)) { |
3374 | ret = PTR_ERR(rbd_dev->spec->image_id); | 3370 | ret = PTR_ERR(rbd_dev->spec->image_id); |
3375 | rbd_dev->spec->image_id = NULL; | 3371 | rbd_dev->spec->image_id = NULL; |
@@ -3393,7 +3389,6 @@ static int rbd_dev_v1_probe(struct rbd_device *rbd_dev) | |||
3393 | rbd_dev->spec->image_id = kstrdup("", GFP_KERNEL); | 3389 | rbd_dev->spec->image_id = kstrdup("", GFP_KERNEL); |
3394 | if (!rbd_dev->spec->image_id) | 3390 | if (!rbd_dev->spec->image_id) |
3395 | return -ENOMEM; | 3391 | return -ENOMEM; |
3396 | rbd_dev->spec->image_id_len = 0; | ||
3397 | 3392 | ||
3398 | /* Record the header object name for this rbd image. */ | 3393 | /* Record the header object name for this rbd image. */ |
3399 | 3394 | ||
@@ -3443,7 +3438,7 @@ static int rbd_dev_v2_probe(struct rbd_device *rbd_dev) | |||
3443 | * Image id was filled in by the caller. Record the header | 3438 | * Image id was filled in by the caller. Record the header |
3444 | * object name for this rbd image. | 3439 | * object name for this rbd image. |
3445 | */ | 3440 | */ |
3446 | size = sizeof (RBD_HEADER_PREFIX) + rbd_dev->spec->image_id_len; | 3441 | size = sizeof (RBD_HEADER_PREFIX) + strlen(rbd_dev->spec->image_id); |
3447 | rbd_dev->header_name = kmalloc(size, GFP_KERNEL); | 3442 | rbd_dev->header_name = kmalloc(size, GFP_KERNEL); |
3448 | if (!rbd_dev->header_name) | 3443 | if (!rbd_dev->header_name) |
3449 | return -ENOMEM; | 3444 | return -ENOMEM; |