mirror of
https://github.com/ceph/ceph
synced 2024-12-19 18:02:46 +00:00
crush: use is_shadow_item() wrapper if possible
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
This commit is contained in:
parent
1b87784f49
commit
4b898951c1
@ -1308,8 +1308,7 @@ pair<string,string> CrushWrapper::get_immediate_parent(int id, int *_ret)
|
||||
crush_bucket *b = crush->buckets[bidx];
|
||||
if (b == 0)
|
||||
continue;
|
||||
const char *n = get_item_name(b->id);
|
||||
if (n && !is_valid_crush_name(n))
|
||||
if (is_shadow_item(b->id))
|
||||
continue;
|
||||
for (unsigned i = 0; i < b->size; i++)
|
||||
if (b->items[i] == id) {
|
||||
@ -1333,8 +1332,7 @@ int CrushWrapper::get_immediate_parent_id(int id, int *parent) const
|
||||
crush_bucket *b = crush->buckets[bidx];
|
||||
if (b == 0)
|
||||
continue;
|
||||
const char *n = get_item_name(b->id);
|
||||
if (n && !is_valid_crush_name(n))
|
||||
if (is_shadow_item(b->id))
|
||||
continue;
|
||||
for (unsigned i = 0; i < b->size; i++) {
|
||||
if (b->items[i] == id) {
|
||||
|
Loading…
Reference in New Issue
Block a user