From 0a2db51bd43a180dcc224ff962dedab9841d8741 Mon Sep 17 00:00:00 2001 From: Peter Rajnoha Date: Mon, 18 Nov 2024 13:10:15 +0100 Subject: [PATCH] res: ucmd-mod: renam sid_ucmd_dev_ready_t to sid_dev_ready_t --- src/include/resource/ucmd-mod.h | 6 ++--- src/modules/ucmd/type/dm/dm.c | 14 +++++------ src/modules/ucmd/type/dm/lvm/lvm.c | 2 +- src/resource/ubr.c | 38 +++++++++++++++--------------- 4 files changed, 30 insertions(+), 30 deletions(-) diff --git a/src/include/resource/ucmd-mod.h b/src/include/resource/ucmd-mod.h index d697592e..bda70421 100644 --- a/src/include/resource/ucmd-mod.h +++ b/src/include/resource/ucmd-mod.h @@ -235,7 +235,7 @@ typedef enum { /* markers for easier state matching */ _SID_DEV_RDY = SID_DEV_RDY_UNINITIALIZED, _SID_DEV_RDY_LAYERED = SID_DEV_RDY_UNAVAILABLE, -} sid_ucmd_dev_ready_t; +} sid_dev_ready_t; typedef enum { SID_DEV_RES_UNDEFINED, /* undefined or invalid */ @@ -245,8 +245,8 @@ typedef enum { SID_DEV_RES_FREE, /* not yet reserved or used by a layer above */ } sid_ucmd_dev_reserved_t; -int sid_ucmd_dev_set_ready(sid_res_t *mod_res, struct sid_ucmd_ctx *ucmd_ctx, sid_ucmd_dev_ready_t ready); -sid_ucmd_dev_ready_t sid_ucmd_dev_get_ready(sid_res_t *mod_res, struct sid_ucmd_ctx *ucmd_ctx, unsigned int archive); +int sid_ucmd_dev_set_ready(sid_res_t *mod_res, struct sid_ucmd_ctx *ucmd_ctx, sid_dev_ready_t ready); +sid_dev_ready_t sid_ucmd_dev_get_ready(sid_res_t *mod_res, struct sid_ucmd_ctx *ucmd_ctx, unsigned int archive); int sid_ucmd_dev_set_reserved(sid_res_t *mod_res, struct sid_ucmd_ctx *ucmd_ctx, sid_ucmd_dev_reserved_t reserved); sid_ucmd_dev_reserved_t sid_ucmd_dev_get_reserved(sid_res_t *mod_res, struct sid_ucmd_ctx *ucmd_ctx, unsigned int archive); diff --git a/src/modules/ucmd/type/dm/dm.c b/src/modules/ucmd/type/dm/dm.c index cdd61182..b55f12ab 100644 --- a/src/modules/ucmd/type/dm/dm.c +++ b/src/modules/ucmd/type/dm/dm.c @@ -677,12 +677,12 @@ SID_UCMD_SCAN_A_INIT(_dm_scan_a_init) */ static int _dm_scan_pre(sid_res_t *mod_res, struct sid_ucmd_ctx *ucmd_ctx) { - sid_ucmd_dev_ready_t ready; - int has_cookie, is_synth, is_suspended; - const void *val; - udev_action_t action; - dm_cookie_flags_t cookie_flags = 0; - int r = 0; + sid_dev_ready_t ready; + int has_cookie, is_synth, is_suspended; + const void *val; + udev_action_t action; + dm_cookie_flags_t cookie_flags = 0; + int r = 0; sid_res_log_debug(mod_res, "scan-pre"); @@ -882,7 +882,7 @@ SID_UCMD_SCAN_POST_NEXT(_dm_scan_post_next) static int _dm_scan_a_exit(sid_res_t *mod_res, struct sid_ucmd_ctx *ucmd_ctx) { - sid_ucmd_dev_ready_t ready; + sid_dev_ready_t ready; const dm_cookie_flags_t *flags; const char *flag_name; int i; diff --git a/src/modules/ucmd/type/dm/lvm/lvm.c b/src/modules/ucmd/type/dm/lvm/lvm.c index 3f46ab0c..de101795 100644 --- a/src/modules/ucmd/type/dm/lvm/lvm.c +++ b/src/modules/ucmd/type/dm/lvm/lvm.c @@ -283,7 +283,7 @@ static int _lvm_scan_pre(sid_res_t *mod_res, struct sid_ucmd_ctx *ucmd_ctx) { static const char failed_to_change_dev_rdy_msg[] = "Failed to change LVM device ready state"; const dm_cookie_flags_t *flags; - sid_ucmd_dev_ready_t ready; + sid_dev_ready_t ready; int r = 0; sid_res_log_debug(mod_res, "scan-pre"); diff --git a/src/resource/ubr.c b/src/resource/ubr.c index 0137e2fd..9f7f5a79 100644 --- a/src/resource/ubr.c +++ b/src/resource/ubr.c @@ -280,7 +280,7 @@ struct sid_ucmd_ctx { sid_res_t *type_mod_res_current; sid_res_t *type_mod_res_next; cmd_scan_phase_t phase; /* current scan phase */ - sid_ucmd_dev_ready_t dev_ready; + sid_dev_ready_t dev_ready; sid_ucmd_dev_reserved_t dev_reserved; } scan; @@ -2887,7 +2887,7 @@ int sid_ucmd_kv_unreserve(sid_res_t *mod_res, struct sid_ucmd_common_ctx *common return _do_sid_ucmd_mod_reserve_kv(mod_res, common, _owner_name(mod_res), dom, ns, key, SID_KV_FL_NONE, 1); } -const char *sid_ucmd_dev_ready_to_str(sid_ucmd_dev_ready_t ready) +const char *sid_ucmd_dev_ready_to_str(sid_dev_ready_t ready) { return dev_ready_str[ready]; } @@ -2900,11 +2900,11 @@ const char *sid_ucmd_dev_reserved_to_str(sid_ucmd_dev_reserved_t reserved) static int _do_sid_ucmd_dev_set_ready(sid_res_t *res, struct sid_ucmd_ctx *ucmd_ctx, const char *owner, - sid_ucmd_dev_ready_t ready, + sid_dev_ready_t ready, bool is_sync) { - sid_ucmd_dev_ready_t old_ready = ucmd_ctx->scan.dev_ready; - int r; + sid_dev_ready_t old_ready = ucmd_ctx->scan.dev_ready; + int r; if (!(_cmd_scan_phase_regs[ucmd_ctx->scan.phase].flags & CMD_SCAN_CAP_RDY)) { r = -EPERM; @@ -2985,7 +2985,7 @@ static int _do_sid_ucmd_dev_set_ready(sid_res_t *res, return r; } -int sid_ucmd_dev_set_ready(sid_res_t *mod_res, struct sid_ucmd_ctx *ucmd_ctx, sid_ucmd_dev_ready_t ready) +int sid_ucmd_dev_set_ready(sid_res_t *mod_res, struct sid_ucmd_ctx *ucmd_ctx, sid_dev_ready_t ready) { if (!mod_res || !ucmd_ctx) return -EINVAL; @@ -2997,11 +2997,11 @@ int sid_ucmd_dev_set_ready(sid_res_t *mod_res, struct sid_ucmd_ctx *ucmd_ctx, si return _do_sid_ucmd_dev_set_ready(mod_res, ucmd_ctx, _owner_name(mod_res), ready, false); } -static sid_ucmd_dev_ready_t +static sid_dev_ready_t _do_sid_ucmd_dev_get_ready(sid_res_t *res, struct sid_ucmd_ctx *ucmd_ctx, const char *owner, unsigned int archive) { - const void *val; - sid_ucmd_dev_ready_t ready_arch; + const void *val; + sid_dev_ready_t ready_arch; if (archive) { if ((val = _do_sid_ucmd_get_kv(res, @@ -3011,7 +3011,7 @@ static sid_ucmd_dev_ready_t &((struct sid_ucmd_kv_get_args) {.ns = SID_KV_NS_DEVICE, .key = KV_KEY_DEV_READY, .archive = archive})))) - memcpy(&ready_arch, val, sizeof(sid_ucmd_dev_ready_t)); + memcpy(&ready_arch, val, sizeof(sid_dev_ready_t)); else ready_arch = SID_DEV_RDY_UNDEFINED; @@ -3024,13 +3024,13 @@ static sid_ucmd_dev_ready_t owner, NULL, &((struct sid_ucmd_kv_get_args) {.ns = SID_KV_NS_DEVICE, .key = KV_KEY_DEV_READY})))) - memcpy(&ucmd_ctx->scan.dev_ready, val, sizeof(sid_ucmd_dev_ready_t)); + memcpy(&ucmd_ctx->scan.dev_ready, val, sizeof(sid_dev_ready_t)); } return ucmd_ctx->scan.dev_ready; } -sid_ucmd_dev_ready_t sid_ucmd_dev_get_ready(sid_res_t *mod_res, struct sid_ucmd_ctx *ucmd_ctx, unsigned int archive) +sid_dev_ready_t sid_ucmd_dev_get_ready(sid_res_t *mod_res, struct sid_ucmd_ctx *ucmd_ctx, unsigned int archive) { if (!mod_res || !ucmd_ctx) return SID_DEV_RDY_UNDEFINED; @@ -3140,7 +3140,7 @@ static sid_ucmd_dev_reserved_t &((struct sid_ucmd_kv_get_args) {.ns = SID_KV_NS_DEVICE, .key = KV_KEY_DEV_RESERVED, .archive = archive})))) - memcpy(&reserved_arch, val, sizeof(sid_ucmd_dev_ready_t)); + memcpy(&reserved_arch, val, sizeof(sid_dev_ready_t)); else reserved_arch = SID_DEV_RES_UNDEFINED; @@ -3154,7 +3154,7 @@ static sid_ucmd_dev_reserved_t owner, NULL, &((struct sid_ucmd_kv_get_args) {.ns = SID_KV_NS_DEVICE, .key = KV_KEY_DEV_RESERVED})))) - memcpy(&ucmd_ctx->scan.dev_reserved, val, sizeof(sid_ucmd_dev_ready_t)); + memcpy(&ucmd_ctx->scan.dev_reserved, val, sizeof(sid_dev_ready_t)); } return ucmd_ctx->scan.dev_reserved; @@ -4154,7 +4154,7 @@ static int _cmd_exec_resources(sid_res_t *cmd_res) static const char *_sval_to_dev_ready_str(kv_scalar_t *val) { - sid_ucmd_dev_ready_t ready; + sid_dev_ready_t ready; memcpy(&ready, val->data + _svalue_ext_data_offset(val), sizeof(ready)); return dev_ready_str[ready]; @@ -4976,7 +4976,7 @@ static int _cmd_exec_scan_a_pre(sid_res_t *cmd_res) static int _cmd_exec_scan_a_current(sid_res_t *cmd_res) { struct sid_ucmd_ctx *ucmd_ctx = sid_res_get_data(cmd_res); - sid_ucmd_dev_ready_t ready = _do_sid_ucmd_dev_get_ready(cmd_res, sid_res_get_data(cmd_res), _owner_name(NULL), 0); + sid_dev_ready_t ready = _do_sid_ucmd_dev_get_ready(cmd_res, sid_res_get_data(cmd_res), _owner_name(NULL), 0); if (ready == SID_DEV_RDY_UNPROCESSED && !ucmd_ctx->scan.type_mod_res_current) { /* @@ -4999,7 +4999,7 @@ static int _cmd_exec_scan_a_current(sid_res_t *cmd_res) static int _cmd_exec_scan_a_next(sid_res_t *cmd_res) { struct sid_ucmd_ctx *ucmd_ctx = sid_res_get_data(cmd_res); - sid_ucmd_dev_ready_t ready; + sid_dev_ready_t ready; const char *next_mod_name; ready = _do_sid_ucmd_dev_get_ready(cmd_res, ucmd_ctx, _owner_name(NULL), 0); @@ -5026,7 +5026,7 @@ static int _cmd_exec_scan_a_next(sid_res_t *cmd_res) static int _cmd_exec_scan_a_post_current(sid_res_t *cmd_res) { struct sid_ucmd_ctx *ucmd_ctx = sid_res_get_data(cmd_res); - sid_ucmd_dev_ready_t ready = _do_sid_ucmd_dev_get_ready(cmd_res, ucmd_ctx, _owner_name(NULL), 0); + sid_dev_ready_t ready = _do_sid_ucmd_dev_get_ready(cmd_res, ucmd_ctx, _owner_name(NULL), 0); if (!UTIL_IN_SET(ready, SID_DEV_RDY_PRIVATE, SID_DEV_RDY_FLAT, SID_DEV_RDY_PUBLIC)) return 1; @@ -5038,7 +5038,7 @@ static int _cmd_exec_scan_a_post_current(sid_res_t *cmd_res) static int _cmd_exec_scan_a_post_next(sid_res_t *cmd_res) { struct sid_ucmd_ctx *ucmd_ctx = sid_res_get_data(cmd_res); - sid_ucmd_dev_ready_t ready = _do_sid_ucmd_dev_get_ready(cmd_res, ucmd_ctx, _owner_name(NULL), 0); + sid_dev_ready_t ready = _do_sid_ucmd_dev_get_ready(cmd_res, ucmd_ctx, _owner_name(NULL), 0); if (!UTIL_IN_SET(ready, SID_DEV_RDY_PUBLIC)) return 1;