Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More bugfixes and remove infrastructure #148

Merged
merged 4 commits into from
Oct 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/include/resource/ucmd-module.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ extern "C" {
#define SID_UCMD_MOD_FN_NAME_SCAN_POST_CURRENT "sid_ucmd_scan_post_current"
#define SID_UCMD_MOD_FN_NAME_SCAN_POST_NEXT "sid_ucmd_scan_post_next"

#define SID_UCMD_MOD_FN_NAME_SCAN_REMOVE "sid_ucmd_scan_remove"

#define SID_UCMD_MOD_FN_NAME_ERROR "sid_ucmd_error"

struct sid_ucmd_common_ctx;
Expand All @@ -62,6 +64,7 @@ struct sid_ucmd_mod_fns {
sid_ucmd_fn_t *scan_post_next;
sid_ucmd_fn_t *trigger_action_current;
sid_ucmd_fn_t *trigger_action_next;
sid_ucmd_fn_t *scan_remove;
sid_ucmd_fn_t *error;
} __packed;

Expand Down Expand Up @@ -123,6 +126,7 @@ struct sid_ucmd_mod_fns {
#define SID_UCMD_SCAN_POST_NEXT(fn) SID_UCMD_FN(scan_post_next, _SID_UCMD_FN_CHECK_TYPE(fn))
#define SID_UCMD_TRIGGER_ACTION_CURRENT(fn) SID_UCMD_FN(trigger_action_current, _SID_UCMD_FN_CHECK_TYPE(fn))
#define SID_UCMD_TRIGGER_ACTION_NEXT(fn) SID_UCMD_FN(trigger_action_next, _SID_UCMD_FN_CHECK_TYPE(fn))
#define SID_UCMD_SCAN_REMOVE(fn) SID_UCMD_FN(scan_emove, _SID_UCMD_FN_CHECK_TYPE(fn))
#define SID_UCMD_ERROR(fn) SID_UCMD_FN(error, _SID_UCMD_FN_CHECK_TYPE(fn))

/*
Expand Down
7 changes: 7 additions & 0 deletions src/modules/ucmd/block/blkid/blkid.c
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,13 @@ static int _blkid_scan_next(struct module *module, struct sid_ucmd_ctx *ucmd_ctx
}
SID_UCMD_SCAN_NEXT(_blkid_scan_next)

static int _blkid_scan_remove(struct module *module, struct sid_ucmd_ctx *ucmd_ctx)
{
log_debug(MID, "scan-remove");
return 0;
}
SID_UCMD_SCAN_REMOVE(_blkid_scan_remove)

static int _blkid_error(struct module *module, struct sid_ucmd_ctx *ucmd_ctx)
{
log_debug(MID, "error");
Expand Down
7 changes: 7 additions & 0 deletions src/modules/ucmd/block/dm_mpath/dm_mpath.c
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,13 @@ static int _dm_mpath_scan_next(struct module *module, struct sid_ucmd_ctx *ucmd_
}
SID_UCMD_SCAN_NEXT(_dm_mpath_scan_next)

static int _dm_mpath_scan_remove(struct module *module, struct sid_ucmd_ctx *ucmd_ctx)
{
log_debug(MID, "scan-remove");
return 0;
}
SID_UCMD_SCAN_REMOVE(_dm_mpath_scan_remove)

static int _dm_mpath_error(struct module *module, struct sid_ucmd_ctx *ucmd_ctx)
{
log_debug(MID, "error");
Expand Down
7 changes: 7 additions & 0 deletions src/modules/ucmd/block/dummy_block/dummy_block.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,13 @@ static int _dummy_block_trigger_action_next(struct module *module, struct sid_uc
}
SID_UCMD_TRIGGER_ACTION_NEXT(_dummy_block_trigger_action_next)

static int _dummy_block_scan_remove(struct module *module, struct sid_ucmd_ctx *ucmd_ctx)
{
log_debug(MID, "scan-remove");
return 0;
}
SID_UCMD_SCAN_REMOVE(_dummy_block_scan_remove)

static int _dummy_block_error(struct module *module, struct sid_ucmd_ctx *ucmd_ctx)
{
log_debug(MID, "error");
Expand Down
25 changes: 25 additions & 0 deletions src/modules/ucmd/type/dm/dm.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ static struct module_symbol_params dm_submod_symbol_params[] = {
SID_UCMD_MOD_FN_NAME_SCAN_POST_NEXT,
MODULE_SYMBOL_INDIRECT,
},
{
SID_UCMD_MOD_FN_NAME_SCAN_REMOVE,
MODULE_SYMBOL_INDIRECT,
},
NULL_MODULE_SYMBOL_PARAMS,
};

Expand All @@ -79,6 +83,7 @@ struct dm_submod_fns {
sid_ucmd_fn_t *scan_next;
sid_ucmd_fn_t *scan_post_current;
sid_ucmd_fn_t *scan_post_next;
sid_ucmd_fn_t *scan_remove;
} __packed;

struct dm_mod_ctx {
Expand Down Expand Up @@ -356,6 +361,26 @@ static int _dm_scan_post_next(struct module *module, struct sid_ucmd_ctx *ucmd_c
}
SID_UCMD_SCAN_POST_NEXT(_dm_scan_post_next)

static int _dm_scan_remove(struct module *module, struct sid_ucmd_ctx *ucmd_ctx)
{
struct dm_mod_ctx *dm_mod;
struct dm_submod_fns *submod_fns;

log_debug(DM_ID, "scan-remove");

dm_mod = module_get_data(module);

if (!dm_mod->submod_res_current)
return 0;

module_registry_get_module_symbols(dm_mod->submod_res_current, (const void ***) &submod_fns);
if (submod_fns && submod_fns->scan_remove)
(void) submod_fns->scan_remove(sid_resource_get_data(dm_mod->submod_res_current), ucmd_ctx);

return 0;
}
SID_UCMD_SCAN_REMOVE(_dm_scan_remove)

static int _dm_error(struct module *module, struct sid_ucmd_ctx *ucmd_ctx)
{
log_debug(DM_ID, "error");
Expand Down
7 changes: 7 additions & 0 deletions src/modules/ucmd/type/dm/lvm/lvm.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,3 +103,10 @@ static int _lvm_scan_post_next(struct module *module, struct sid_ucmd_ctx *ucmd_
return 0;
}
SID_UCMD_SCAN_POST_NEXT(_lvm_scan_post_next)

static int _lvm_scan_remove(struct module *module, struct sid_ucmd_ctx *ucmd_ctx)
{
log_debug(LVM_ID, "scan-remove");
return 0;
}
SID_UCMD_SCAN_REMOVE(_lvm_scan_remove)
7 changes: 7 additions & 0 deletions src/modules/ucmd/type/dummy_type/dummy_type.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,13 @@ static int _dummy_type_trigger_action_next(struct module *module, struct sid_ucm
}
SID_UCMD_TRIGGER_ACTION_NEXT(_dummy_type_trigger_action_next)

static int _dummy_type_scan_remove(struct module *module, struct sid_ucmd_ctx *ucmd_ctx)
{
log_debug(MID, "scan-remove");
return 0;
}
SID_UCMD_SCAN_REMOVE(_dummy_type_scan_remove)

static int _dummy_type_error(struct module *module, struct sid_ucmd_ctx *ucmd_ctx)
{
log_debug(MID, "error");
Expand Down
Loading
Loading