mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
Event number support.
This commit is contained in:
parent
fe451a01e8
commit
8563ab0304
@ -13,6 +13,7 @@ Base {
|
|||||||
dm_task_get_uuid;
|
dm_task_get_uuid;
|
||||||
dm_task_set_ro;
|
dm_task_set_ro;
|
||||||
dm_task_set_newname;
|
dm_task_set_newname;
|
||||||
|
dm_task_set_event_nr;
|
||||||
dm_task_set_major;
|
dm_task_set_major;
|
||||||
dm_task_set_minor;
|
dm_task_set_minor;
|
||||||
dm_task_add_target;
|
dm_task_add_target;
|
||||||
|
@ -128,6 +128,7 @@ static int _dm_task_get_info_v1(struct dm_task *dmt, struct dm_info *info)
|
|||||||
info->read_only = dmt->dmi.v1->flags & DM_READONLY_FLAG ? 1 : 0;
|
info->read_only = dmt->dmi.v1->flags & DM_READONLY_FLAG ? 1 : 0;
|
||||||
info->target_count = dmt->dmi.v1->target_count;
|
info->target_count = dmt->dmi.v1->target_count;
|
||||||
info->open_count = dmt->dmi.v1->open_count;
|
info->open_count = dmt->dmi.v1->open_count;
|
||||||
|
info->event_nr = 0;
|
||||||
info->major = MAJOR(dmt->dmi.v1->dev);
|
info->major = MAJOR(dmt->dmi.v1->dev);
|
||||||
info->minor = MINOR(dmt->dmi.v1->dev);
|
info->minor = MINOR(dmt->dmi.v1->dev);
|
||||||
|
|
||||||
@ -513,6 +514,7 @@ int dm_task_get_info(struct dm_task *dmt, struct dm_info *info)
|
|||||||
info->read_only = dmt->dmi.v3->flags & DM_READONLY_FLAG ? 1 : 0;
|
info->read_only = dmt->dmi.v3->flags & DM_READONLY_FLAG ? 1 : 0;
|
||||||
info->target_count = dmt->dmi.v3->target_count;
|
info->target_count = dmt->dmi.v3->target_count;
|
||||||
info->open_count = dmt->dmi.v3->open_count;
|
info->open_count = dmt->dmi.v3->open_count;
|
||||||
|
info->event_nr = dmt->dmi.v3->event_nr;
|
||||||
info->major = MAJOR(dmt->dmi.v3->dev);
|
info->major = MAJOR(dmt->dmi.v3->dev);
|
||||||
info->minor = MINOR(dmt->dmi.v3->dev);
|
info->minor = MINOR(dmt->dmi.v3->dev);
|
||||||
|
|
||||||
@ -552,6 +554,13 @@ int dm_task_set_newname(struct dm_task *dmt, const char *newname)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int dm_task_set_event_nr(struct dm_task *dmt, uint32_t event_nr)
|
||||||
|
{
|
||||||
|
dmt->event_nr = event_nr;
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
struct target *create_target(uint64_t start, uint64_t len, const char *type,
|
struct target *create_target(uint64_t start, uint64_t len, const char *type,
|
||||||
const char *params)
|
const char *params)
|
||||||
{
|
{
|
||||||
@ -691,6 +700,7 @@ static struct dm_ioctl *_flatten(struct dm_task *dmt)
|
|||||||
strncpy(dmi->uuid, dmt->uuid, sizeof(dmi->uuid));
|
strncpy(dmi->uuid, dmt->uuid, sizeof(dmi->uuid));
|
||||||
|
|
||||||
dmi->target_count = count;
|
dmi->target_count = count;
|
||||||
|
dmi->event_nr = dmt->event_nr;
|
||||||
|
|
||||||
b = (void *) (dmi + 1);
|
b = (void *) (dmi + 1);
|
||||||
e = (void *) ((char *) dmi + len);
|
e = (void *) ((char *) dmi + len);
|
||||||
|
@ -28,6 +28,7 @@ struct dm_task {
|
|||||||
struct target *head, *tail;
|
struct target *head, *tail;
|
||||||
|
|
||||||
int read_only;
|
int read_only;
|
||||||
|
uint32_t event_nr;
|
||||||
int major;
|
int major;
|
||||||
int minor;
|
int minor;
|
||||||
union {
|
union {
|
||||||
|
@ -66,6 +66,7 @@ struct dm_info {
|
|||||||
int exists;
|
int exists;
|
||||||
int suspended;
|
int suspended;
|
||||||
int32_t open_count;
|
int32_t open_count;
|
||||||
|
uint32_t event_nr;
|
||||||
uint32_t major;
|
uint32_t major;
|
||||||
uint32_t minor; /* minor device number */
|
uint32_t minor; /* minor device number */
|
||||||
int read_only; /* 0:read-write; 1:read-only */
|
int read_only; /* 0:read-write; 1:read-only */
|
||||||
@ -90,6 +91,7 @@ int dm_task_set_ro(struct dm_task *dmt);
|
|||||||
int dm_task_set_newname(struct dm_task *dmt, const char *newname);
|
int dm_task_set_newname(struct dm_task *dmt, const char *newname);
|
||||||
int dm_task_set_minor(struct dm_task *dmt, int minor);
|
int dm_task_set_minor(struct dm_task *dmt, int minor);
|
||||||
int dm_task_set_major(struct dm_task *dmt, int major);
|
int dm_task_set_major(struct dm_task *dmt, int major);
|
||||||
|
int dm_task_set_event_nr(struct dm_task *dmt, uint32_t event_nr);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Use these to prepare for a create or reload.
|
* Use these to prepare for a create or reload.
|
||||||
|
Loading…
Reference in New Issue
Block a user