Skip to content

Commit

Permalink
DAOS-10250 control: Get enabled and disabled ranks with dmg pool query
Browse files Browse the repository at this point in the history
Fix reviewers comments:
- Improve code readability

Features: control dmg
Required-githooks: true

Signed-off-by: Cedric Koch-Hofer <[email protected]>
  • Loading branch information
kanard38 authored and knard-intel committed May 29, 2024
1 parent 9bac4e9 commit 29e8d0e
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/mgmt/tests/mocks.c
Original file line number Diff line number Diff line change
Expand Up @@ -293,22 +293,26 @@ ds_mgmt_pool_query(uuid_t pool_uuid, d_rank_list_t *svc_ranks, d_rank_list_t **e

uuid_copy(ds_mgmt_pool_query_uuid, pool_uuid);
ds_mgmt_pool_query_info_ptr = (void *)pool_info;
if (pool_info != NULL && (pool_info->pi_bits & DPI_ENGINES_ENABLED) != 0) {

if (pool_info == NULL)
return ds_mgmt_pool_query_return;

if ((pool_info->pi_bits & DPI_ENGINES_ENABLED) != 0) {
D_ASSERT(enabled_ranks != NULL);

*enabled_ranks = d_rank_list_alloc(8); /* 0-7 ; caller must free this */
ds_mgmt_pool_query_enabled_ranks_out = *enabled_ranks;
}
if (pool_info != NULL && (pool_info->pi_bits & DPI_ENGINES_DISABLED) != 0) {
if ((pool_info->pi_bits & DPI_ENGINES_DISABLED) != 0) {
D_ASSERT(disabled_ranks != NULL);

*disabled_ranks = d_rank_list_alloc(4); /* 0-4 ; caller must free this */
ds_mgmt_pool_query_disabled_ranks_out = *disabled_ranks;
}
if (pool_info != NULL) {
ds_mgmt_pool_query_info_in = *pool_info;
*pool_info = ds_mgmt_pool_query_info_out;
}

ds_mgmt_pool_query_info_in = *pool_info;
*pool_info = ds_mgmt_pool_query_info_out;

return ds_mgmt_pool_query_return; /* 0 */
}

Expand Down

0 comments on commit 29e8d0e

Please sign in to comment.