-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathctl_sds.c
More file actions
57 lines (43 loc) · 1.14 KB
/
ctl_sds.c
File metadata and controls
57 lines (43 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
// SPDX-License-Identifier: BSD-3-Clause
/* Copyright 2018-2021, Intel Corporation */
/* Copyright 2025, Hewlett Packard Enterprise Development LP */
/*
* ctl_sds.c -- implementation of the sds CTL namespace
*/
#include "ctl.h"
#include "set.h"
#include "out.h"
#include "ctl_global.h"
static int
CTL_READ_HANDLER(at_create)(void *ctx, enum ctl_query_source source,
void *arg, struct ctl_indexes *indexes)
{
/* suppress unused-parameter errors */
SUPPRESS_UNUSED(ctx, source, indexes);
int *arg_out = arg;
*arg_out = SDS_at_create;
return 0;
}
static int
CTL_WRITE_HANDLER(at_create)(void *ctx, enum ctl_query_source source,
void *arg, struct ctl_indexes *indexes)
{
/* suppress unused-parameter errors */
SUPPRESS_UNUSED(ctx, source, indexes);
int arg_in = *(int *)arg;
if (SDS_at_create != arg_in && arg_in == 0) {
CORE_LOG_HARK("PMEM feature disabled: SDS_at_create=0");
}
SDS_at_create = arg_in;
return 0;
}
static const struct ctl_argument CTL_ARG(at_create) = CTL_ARG_BOOLEAN;
static const struct ctl_node CTL_NODE(sds)[] = {
CTL_LEAF_RW(at_create),
CTL_NODE_END
};
void
ctl_sds_register(void)
{
CTL_REGISTER_MODULE(NULL, sds);
}