1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-02-23 13:57:47 +03:00

Fix target_register_events args.

This commit is contained in:
Alasdair Kergon 2006-05-25 13:32:26 +00:00
parent c51a13caa6
commit f2bdbe0d4d
4 changed files with 11 additions and 19 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.07 -
=================================
Fix target_register_events args.
Prevent snapshots of mirrors.
Add DISTCLEAN_TARGETS to make template for configure.h.
More fixes to error paths.

View File

@ -598,8 +598,7 @@ int register_dev_for_events(struct cmd_context *cmd,
int r = 0;
struct list *tmp;
struct lv_segment *seg;
int (*reg) (struct dm_pool *mem, struct lv_segment *,
struct config_tree *cft, int events);
int (*reg) (struct lv_segment *, int events);
if (do_reg && !dmeventd_register_mode())
return 1;
@ -619,7 +618,7 @@ int register_dev_for_events(struct cmd_context *cmd,
continue;
/* FIXME specify events */
if (!reg(cmd->mem, seg, cmd->cft, 0)) {
if (!reg(seg, 0)) {
stack;
return -1;
}

View File

@ -78,12 +78,8 @@ struct segtype_handler {
uint64_t *total_denominator, float *percent);
int (*target_present) (void);
void (*destroy) (const struct segment_type * segtype);
int (*target_register_events) (struct dm_pool *mem,
struct lv_segment *seg,
struct cmd_context *cmd, int events);
int (*target_unregister_events) (struct dm_pool *mem,
struct lv_segment *seg,
struct cmd_context *cmd, int events);
int (*target_register_events) (struct lv_segment *seg, int events);
int (*target_unregister_events) (struct lv_segment *seg, int events);
};
struct segment_type *get_segtype_from_string(struct cmd_context *cmd,

View File

@ -390,9 +390,7 @@ static int _setup_registration(struct dm_pool *mem, struct cmd_context *cmd,
/* FIXME This gets run while suspended and performs banned operations. */
/* FIXME Merge these two functions */
static int _target_register_events(struct cmd_context *cmd,
struct dm_pool *mem,
struct lv_segment *seg,
static int _target_register_events(struct lv_segment *seg,
int events)
{
char *dso, *name;
@ -402,12 +400,12 @@ static int _target_register_events(struct cmd_context *cmd,
lv = seg->lv;
vg = lv->vg;
if (!_setup_registration(mem, cmd, &dso)) {
if (!_setup_registration(vg->cmd->mem, vg->cmd, &dso)) {
stack;
return 0;
}
if (!(name = build_dm_name(mem, vg->name, lv->name, NULL)))
if (!(name = build_dm_name(vg->cmd->mem, vg->name, lv->name, NULL)))
return_0;
/* FIXME Save a returned handle here so we can unregister it later */
@ -419,9 +417,7 @@ static int _target_register_events(struct cmd_context *cmd,
return 1;
}
static int _target_unregister_events(struct cmd_context *cmd,
struct dm_pool *mem,
struct lv_segment *seg,
static int _target_unregister_events(struct lv_segment *seg,
int events)
{
char *dso;
@ -433,10 +429,10 @@ static int _target_unregister_events(struct cmd_context *cmd,
vg = lv->vg;
/* FIXME Remove this and use handle to avoid config file race */
if (!_setup_registration(mem, cmd, &dso))
if (!_setup_registration(vg->cmd->mem, vg->cmd, &dso))
return_0;
if (!(name = build_dm_name(mem, vg->name, lv->name, NULL)))
if (!(name = build_dm_name(vg->cmd->mem, vg->name, lv->name, NULL)))
return_0;
/* FIXME Use handle returned by registration function instead of dso */