diff options
author | Alex Elder <elder@inktank.com> | 2012-10-30 19:40:33 -0500 |
---|---|---|
committer | Alex Elder <elder@inktank.com> | 2012-11-01 07:55:42 -0500 |
commit | 2c0d0a10ea89456781218f458f6bf72e99d87d2a (patch) | |
tree | d813b4eaebe1cadf6964347a304bc40e85fab757 | |
parent | 83a06263625b823afa3a842ddbf53473c22f24b2 (diff) | |
download | op-kernel-dev-2c0d0a10ea89456781218f458f6bf72e99d87d2a.zip op-kernel-dev-2c0d0a10ea89456781218f458f6bf72e99d87d2a.tar.gz |
rbd: allow null image name
We will know the image id for format 2 parent images, but won't
initially know its image name. Avoid making the query for an image
id in rbd_dev_image_id() if it's already known.
Signed-off-by: Alex Elder <elder@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
-rw-r--r-- | drivers/block/rbd.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index 8d26c0f..a852133 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c @@ -3068,6 +3068,14 @@ static int rbd_dev_image_id(struct rbd_device *rbd_dev) void *p; /* + * When probing a parent image, the image id is already + * known (and the image name likely is not). There's no + * need to fetch the image id again in this case. + */ + if (rbd_dev->spec->image_id) + return 0; + + /* * First, see if the format 2 image id file exists, and if * so, get the image's persistent id from it. */ |