mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
Allow device major to be set too.
This commit is contained in:
parent
6a149cba6b
commit
12428fceee
@ -13,6 +13,7 @@ Base {
|
||||
dm_task_get_uuid;
|
||||
dm_task_set_ro;
|
||||
dm_task_set_newname;
|
||||
dm_task_set_major;
|
||||
dm_task_set_minor;
|
||||
dm_task_add_target;
|
||||
dm_get_next_target;
|
||||
|
@ -238,7 +238,7 @@ static struct dm_ioctl_v1 *_flatten_v1(struct dm_task *dmt)
|
||||
|
||||
if (dmt->minor >= 0) {
|
||||
dmi->flags |= DM_PERSISTENT_DEV_FLAG;
|
||||
dmi->dev = MKDEV(0, dmt->minor);
|
||||
dmi->dev = MKDEV((dmt->major >= 0) ? : 0, dmt->minor);
|
||||
}
|
||||
|
||||
if (dmt->uuid)
|
||||
|
@ -28,6 +28,7 @@ struct dm_task {
|
||||
struct target *head, *tail;
|
||||
|
||||
int read_only;
|
||||
int major;
|
||||
int minor;
|
||||
union {
|
||||
struct dm_ioctl *v3;
|
||||
|
@ -89,6 +89,7 @@ struct dm_deps *dm_task_get_deps(struct dm_task *dmt);
|
||||
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_minor(struct dm_task *dmt, int minor);
|
||||
int dm_task_set_major(struct dm_task *dmt, int major);
|
||||
|
||||
/*
|
||||
* Use these to prepare for a create or reload.
|
||||
|
@ -94,6 +94,7 @@ struct dm_task *dm_task_create(int type)
|
||||
|
||||
dmt->type = type;
|
||||
dmt->minor = -1;
|
||||
dmt->major = -1;
|
||||
|
||||
return dmt;
|
||||
}
|
||||
@ -148,6 +149,14 @@ int dm_task_set_uuid(struct dm_task *dmt, const char *uuid)
|
||||
return 1;
|
||||
}
|
||||
|
||||
int dm_task_set_major(struct dm_task *dmt, int major)
|
||||
{
|
||||
dmt->major = major;
|
||||
log_debug("Setting major: %d", dmt->major);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
int dm_task_set_minor(struct dm_task *dmt, int minor)
|
||||
{
|
||||
dmt->minor = minor;
|
||||
|
Loading…
Reference in New Issue
Block a user