From: Sage Weil Date: Fri, 4 May 2012 01:59:02 +0000 (-0700) Subject: crush: clean up check_item_loc() comments X-Git-Tag: v0.47~47^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=684558ace9e29303cde02b5542f2df1962cab661;p=ceph.git crush: clean up check_item_loc() comments Thanks Greg! Signed-off-by: Sage Weil --- diff --git a/src/crush/CrushWrapper.cc b/src/crush/CrushWrapper.cc index 9d9307b1f34d..fc30f2de1797 100644 --- a/src/crush/CrushWrapper.cc +++ b/src/crush/CrushWrapper.cc @@ -66,7 +66,7 @@ int CrushWrapper::remove_item(CephContext *cct, int item) } bool CrushWrapper::check_item_loc(CephContext *cct, int item, map& loc, - float *weight) // typename -> bucketname + float *weight) { ldout(cct, 5) << "check_item_loc item " << item << " loc " << loc << dendl; @@ -96,14 +96,15 @@ bool CrushWrapper::check_item_loc(CephContext *cct, int item, map crush_bucket *b = get_bucket(id); assert(b); - // make sure the item doesn't already exist in this bucket - for (unsigned j=0; jsize; j++) + // see if item exists in this bucket + for (unsigned j=0; jsize; j++) { if (b->items[j] == cur) { ldout(cct, 2) << "check_item_loc " << cur << " exists in bucket " << b->id << dendl; if (weight) *weight = (float)crush_get_bucket_item_weight(b, j) / (float)0x10000; return true; } + } return false; } diff --git a/src/crush/CrushWrapper.h b/src/crush/CrushWrapper.h index cd0b32c79a76..d12cd835fa40 100644 --- a/src/crush/CrushWrapper.h +++ b/src/crush/CrushWrapper.h @@ -171,6 +171,7 @@ public: * @param cct cct * @param item item id * @param loc location to check (map of type to bucket names) + * @param weight optional pointer to weight of item at that location */ bool check_item_loc(CephContext *cct, int item, map& loc, float *weight);