return mount_fd(source, fd, filesystemtype, mountflags, data);
}
-const char *mount_propagation_flags_to_string(unsigned long flags) {
+const char *mount_propagation_flag_to_string(unsigned long flags) {
switch (flags & (MS_SHARED|MS_SLAVE|MS_PRIVATE)) {
case 0:
return NULL;
}
-int mount_propagation_flags_from_string(const char *name, unsigned long *ret) {
+int mount_propagation_flag_from_string(const char *name, unsigned long *ret) {
if (isempty(name))
*ret = 0;
int mount_fd(const char *source, int target_fd, const char *filesystemtype, unsigned long mountflags, const void *data);
int mount_nofollow(const char *source, const char *target, const char *filesystemtype, unsigned long mountflags, const void *data);
-const char *mount_propagation_flags_to_string(unsigned long flags);
-int mount_propagation_flags_from_string(const char *name, unsigned long *ret);
+const char *mount_propagation_flag_to_string(unsigned long flags);
+int mount_propagation_flag_from_string(const char *name, unsigned long *ret);
return 0;
}
-static const char* mount_propagation_flags_to_string_with_check(unsigned long n) {
+static const char* mount_propagation_flag_to_string_with_check(unsigned long n) {
if (!IN_SET(n, 0, MS_SHARED, MS_PRIVATE, MS_SLAVE))
return NULL;
- return mount_propagation_flags_to_string(n);
+ return mount_propagation_flag_to_string(n);
}
static BUS_DEFINE_SET_TRANSIENT(nsec, "t", uint64_t, nsec_t, NSEC_FMT);
static BUS_DEFINE_SET_TRANSIENT_TO_STRING_ALLOC(secure_bits, "i", int32_t, int, "%" PRIi32, secure_bits_to_string_alloc_with_check);
static BUS_DEFINE_SET_TRANSIENT_TO_STRING_ALLOC(capability, "t", uint64_t, uint64_t, "%" PRIu64, capability_set_to_string_alloc);
static BUS_DEFINE_SET_TRANSIENT_TO_STRING_ALLOC(namespace_flag, "t", uint64_t, unsigned long, "%" PRIu64, namespace_flags_to_string);
-static BUS_DEFINE_SET_TRANSIENT_TO_STRING(mount_flags, "t", uint64_t, unsigned long, "%" PRIu64, mount_propagation_flags_to_string_with_check);
+static BUS_DEFINE_SET_TRANSIENT_TO_STRING(mount_flags, "t", uint64_t, unsigned long, "%" PRIu64, mount_propagation_flag_to_string_with_check);
int bus_exec_context_set_transient_property(
Unit *u,
DEFINE_CONFIG_PARSE_PTR(config_parse_cg_weight, cg_weight_parse, uint64_t, "Invalid weight");
DEFINE_CONFIG_PARSE_PTR(config_parse_cg_cpu_weight, cg_cpu_weight_parse, uint64_t, "Invalid CPU weight");
static DEFINE_CONFIG_PARSE_PTR(config_parse_cpu_shares_internal, cg_cpu_shares_parse, uint64_t, "Invalid CPU shares");
-DEFINE_CONFIG_PARSE_PTR(config_parse_exec_mount_flags, mount_propagation_flags_from_string, unsigned long, "Failed to parse mount flag");
+DEFINE_CONFIG_PARSE_PTR(config_parse_exec_mount_flags, mount_propagation_flag_from_string, unsigned long, "Failed to parse mount flag");
DEFINE_CONFIG_PARSE_ENUM_WITH_DEFAULT(config_parse_numa_policy, mpol, int, -1, "Invalid NUMA policy type");
DEFINE_CONFIG_PARSE_ENUM(config_parse_status_unit_format, status_unit_format, StatusUnitFormat, "Failed to parse status unit format");
DEFINE_CONFIG_PARSE_ENUM_FULL(config_parse_socket_timestamping, socket_timestamping_from_string_harder, SocketTimestamping, "Failed to parse timestamping precision");
} else if (streq(name, "MountFlags")) {
const char *result;
- result = mount_propagation_flags_to_string(u);
+ result = mount_propagation_flag_to_string(u);
if (!result)
return -EINVAL;
DEFINE_BUS_APPEND_PARSE_PTR("t", uint64_t, uint64_t, cg_cpu_shares_parse);
DEFINE_BUS_APPEND_PARSE_PTR("t", uint64_t, uint64_t, cg_weight_parse);
DEFINE_BUS_APPEND_PARSE_PTR("t", uint64_t, uint64_t, cg_cpu_weight_parse);
-DEFINE_BUS_APPEND_PARSE_PTR("t", uint64_t, unsigned long, mount_propagation_flags_from_string);
+DEFINE_BUS_APPEND_PARSE_PTR("t", uint64_t, unsigned long, mount_propagation_flag_from_string);
DEFINE_BUS_APPEND_PARSE_PTR("t", uint64_t, uint64_t, safe_atou64);
DEFINE_BUS_APPEND_PARSE_PTR("u", uint32_t, mode_t, parse_mode);
DEFINE_BUS_APPEND_PARSE_PTR("u", uint32_t, unsigned, safe_atou);
return bus_append_safe_atou(m, field, eq);
if (streq(field, "MountFlags"))
- return bus_append_mount_propagation_flags_from_string(m, field, eq);
+ return bus_append_mount_propagation_flag_from_string(m, field, eq);
if (STR_IN_SET(field, "Environment",
"UnsetEnvironment",
#include "tests.h"
#include "tmpfile-util.h"
-static void test_mount_propagation_flags_one(const char *name, int ret, unsigned long expected) {
+static void test_mount_propagation_flag_one(const char *name, int ret, unsigned long expected) {
unsigned long flags;
log_info("/* %s(%s) */", __func__, strnull(name));
- assert_se(mount_propagation_flags_from_string(name, &flags) == ret);
+ assert_se(mount_propagation_flag_from_string(name, &flags) == ret);
if (ret >= 0) {
const char *c;
assert_se(flags == expected);
- c = mount_propagation_flags_to_string(flags);
+ c = mount_propagation_flag_to_string(flags);
if (isempty(name))
assert_se(isempty(c));
else
}
}
-TEST(mount_propagation_flags) {
- test_mount_propagation_flags_one("shared", 0, MS_SHARED);
- test_mount_propagation_flags_one("slave", 0, MS_SLAVE);
- test_mount_propagation_flags_one("private", 0, MS_PRIVATE);
- test_mount_propagation_flags_one(NULL, 0, 0);
- test_mount_propagation_flags_one("", 0, 0);
- test_mount_propagation_flags_one("xxxx", -EINVAL, 0);
- test_mount_propagation_flags_one(" ", -EINVAL, 0);
+TEST(mount_propagation_flag) {
+ test_mount_propagation_flag_one("shared", 0, MS_SHARED);
+ test_mount_propagation_flag_one("slave", 0, MS_SLAVE);
+ test_mount_propagation_flag_one("private", 0, MS_PRIVATE);
+ test_mount_propagation_flag_one(NULL, 0, 0);
+ test_mount_propagation_flag_one("", 0, 0);
+ test_mount_propagation_flag_one("xxxx", -EINVAL, 0);
+ test_mount_propagation_flag_one(" ", -EINVAL, 0);
}
TEST(mnt_id) {