From: Danny Al-Gaaf Date: Wed, 17 Feb 2016 15:00:57 +0000 (+0100) Subject: librbd/ImageCtx.cc: reduce scope of variable X-Git-Tag: v10.1.0~312^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=1f0c1b1a7e78b2be56b9f532e968efc731ba4707;p=ceph.git librbd/ImageCtx.cc: reduce scope of variable Signed-off-by: Danny Al-Gaaf --- diff --git a/src/librbd/ImageCtx.cc b/src/librbd/ImageCtx.cc index 762d637421e2..cea007a91eaf 100644 --- a/src/librbd/ImageCtx.cc +++ b/src/librbd/ImageCtx.cc @@ -930,13 +930,12 @@ struct C_InvalidateCache : public Context { "rbd_journal_pool", false); string start = METADATA_CONF_PREFIX; - int r = 0, j = 0; md_config_t local_config_t; bool retrieve_metadata = !old_format; while (retrieve_metadata) { map pairs, res; - r = cls_client::metadata_list(&md_ctx, header_oid, start, max_conf_items, + int r = cls_client::metadata_list(&md_ctx, header_oid, start, max_conf_items, &pairs); if (r == -EOPNOTSUPP || r == -EIO) { ldout(cct, 10) << "config metadata not supported by OSD" << dendl; @@ -955,7 +954,7 @@ struct C_InvalidateCache : public Context { for (map::iterator it = res.begin(); it != res.end(); ++it) { string val(it->second.c_str(), it->second.length()); - j = local_config_t.set_val(it->first.c_str(), val); + int j = local_config_t.set_val(it->first.c_str(), val); if (j < 0) { lderr(cct) << __func__ << " failed to set config " << it->first << " with value " << it->second.c_str() << ": " << j