Skip to content

Commit 94ca030

Browse files
committed
TEST
1 parent 2d69eb6 commit 94ca030

File tree

3 files changed

+6
-16
lines changed

3 files changed

+6
-16
lines changed

src/ctl/ctl.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -410,14 +410,10 @@ int ctl_query(struct ctl *ctl, void *ctx, umf_ctl_query_source_t source,
410410
errno = EINVAL;
411411
goto out;
412412
}
413-
const char *extra_name = &name[0];
414-
if (strstr(extra_name, "by_handle") != NULL) {
415-
extra_name = &name[0] + name_offset;
416-
}
417413

418414
ret =
419415
ctl_exec_query[n->type == CTL_NODE_SUBTREE ? CTL_QUERY_SUBTREE : type](
420-
ctx, n, source, arg, size, indexes, extra_name, type);
416+
ctx, n, source, arg, size, indexes, name + name_offset, type);
421417
out:
422418
ctl_delete_indexes(indexes);
423419

src/memory_pool.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ static int CTL_SUBTREE_HANDLER(default)(void *ctx,
5050
const char *extra_name,
5151
umf_ctl_query_type_t queryType) {
5252
(void)indexes, (void)source, (void)size, (void)ctx;
53-
// assert(queryType == CTL_QUERY_WRITE && "not supported query type");
53+
5454
if (queryType == CTL_QUERY_WRITE) {
5555
int i = 0;
5656
for (; i < UMF_DEFAULT_SIZE; i++) {
@@ -72,10 +72,6 @@ static int CTL_SUBTREE_HANDLER(default)(void *ctx,
7272
break;
7373
}
7474
}
75-
if (UMF_DEFAULT_SIZE == i) {
76-
LOG_ERR("Default entries array is full");
77-
return -1;
78-
}
7975
}
8076
return 0;
8177
}

src/pool/pool_disjoint_ctl.h

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
66
*/
77

8-
#include "pool/pool_disjoint_internal.h"
9-
#include <stdio.h>
108
#include <string.h>
119

1210
#include <ctl/ctl.h>
@@ -15,6 +13,8 @@
1513
#include <umf/memory_pool_ops.h>
1614
#include <umf/memory_provider.h>
1715

16+
#include "pool/pool_disjoint_internal.h"
17+
1818
struct ctl disjoint_ctl_root;
1919
static UTIL_ONCE_FLAG ctl_initialized = UTIL_ONCE_FLAG_INIT;
2020

@@ -23,16 +23,14 @@ static int CTL_READ_HANDLER(name)(void *ctx, umf_ctl_query_source_t source,
2323
umf_ctl_index_utlist_t *indexes,
2424
const char *extra_name,
2525
umf_ctl_query_type_t queryType) {
26-
(void)source, (void)indexes, (void)queryType, (void)size;
26+
(void)source, (void)indexes, (void)queryType, (void)size, (void)extra_name;
2727
disjoint_pool_t *pool = (disjoint_pool_t *)ctx;
2828

2929
if (arg == NULL) {
3030
return -1;
3131
}
3232

33-
if (strstr(extra_name, pool->params.name) != NULL) {
34-
strncpy(pool->params.name, (char *)arg, sizeof(pool->params.name) - 1);
35-
}
33+
strncpy(pool->params.name, (char *)arg, sizeof(pool->params.name) - 1);
3634
return 0;
3735
}
3836

0 commit comments

Comments
 (0)