On 10/30/2012 06:09 AM, Alex Elder wrote:
On 10/29/2012 05:30 PM, Josh Durgin wrote:
On 10/26/2012 04:03 PM, Alex Elder wrote:
Pass the address of an rbd_spec structure to rbd_add_parse_args().
Use it to hold the information defining the rbd image to be mapped
in an rbd_add() call.
Use the result in the caller to initialize the rbd_dev->id field.
This means rbd_dev is no longer needed in rbd_add_parse_args(),
so get rid of it.
Now that this transformation of rbd_add_parse_args() is complete,
correct and expand on the its header documentation to reflect the
new reality.
Signed-off-by: Alex Elder <elder@xxxxxxxxxxx>
---
drivers/block/rbd.c | 104
++++++++++++++++++++++++++++++++++-----------------
1 file changed, 70 insertions(+), 34 deletions(-)
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index 19c7c6b..28abd31 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
. . .
@@ -2973,15 +3008,15 @@ static int rbd_add_parse_args(struct rbd_device
*rbd_dev,
}
*opts = rbd_opts;
+ *rbd_spec = spec;
+
return 0;
out_mem:
ret = -ENOMEM;
+ kfree(spec->image_name);
+ kfree(spec->pool_name);
+ kfree(spec);
This is missing spec->snap_name. Why not use rbd_spec_put()?
You're right, and you're right. It was an oversight. I'll fix
that. Do you want me to repost?
No, the change is trivial enough. You can add my reviewed-by with that.
In keeping with some of your previous comments I have also added
a note to include in a future patch messages about why a map
request failed in rbd_add() via a log message.
Sounds good.
-Alex
out_err:
- kfree(rbd_dev->spec->image_name);
- rbd_dev->spec->image_name = NULL;
- rbd_dev->spec->image_name_len = 0;
- kfree(rbd_dev->spec->pool_name);
- rbd_dev->spec->pool_name = NULL;
kfree(options);
. . .
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html