1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-03 05:18:29 +03:00

Non-functional change - refactor lv_create_empty().

Remove struct format_instance param - we can safely obtain
this from vg->fid inside the function.
This commit is contained in:
Dave Wysochanski 2007-10-11 19:20:38 +00:00
parent 8fd14f09e2
commit 9ea1d647af
7 changed files with 8 additions and 10 deletions

View File

@ -1656,14 +1656,14 @@ char *generate_lv_name(struct volume_group *vg, const char *format,
/* /*
* Create a new empty LV. * Create a new empty LV.
*/ */
struct logical_volume *lv_create_empty(struct format_instance *fi, struct logical_volume *lv_create_empty(const char *name,
const char *name,
union lvid *lvid, union lvid *lvid,
uint32_t status, uint32_t status,
alloc_policy_t alloc, alloc_policy_t alloc,
int import, int import,
struct volume_group *vg) struct volume_group *vg)
{ {
struct format_instance *fi = vg->fid;
struct cmd_context *cmd = vg->cmd; struct cmd_context *cmd = vg->cmd;
struct lv_list *ll = NULL; struct lv_list *ll = NULL;
struct logical_volume *lv; struct logical_volume *lv;

View File

@ -349,8 +349,7 @@ int vg_split_mdas(struct cmd_context *cmd, struct volume_group *vg_from,
struct volume_group *vg_to); struct volume_group *vg_to);
/* Manipulate LVs */ /* Manipulate LVs */
struct logical_volume *lv_create_empty(struct format_instance *fi, struct logical_volume *lv_create_empty(const char *name,
const char *name,
union lvid *lvid, union lvid *lvid,
uint32_t status, uint32_t status,
alloc_policy_t alloc, alloc_policy_t alloc,

View File

@ -439,7 +439,7 @@ static int _create_layers_for_mirror(struct alloc_handle *ah,
} }
for (m = 0; m < num_mirrors; m++) { for (m = 0; m < num_mirrors; m++) {
if (!(img_lvs[m] = lv_create_empty(lv->vg->fid, img_name, if (!(img_lvs[m] = lv_create_empty(img_name,
NULL, LVM_READ | LVM_WRITE, NULL, LVM_READ | LVM_WRITE,
ALLOC_INHERIT, 0, lv->vg))) { ALLOC_INHERIT, 0, lv->vg))) {
log_error("Aborting. Failed to create mirror image LV. " log_error("Aborting. Failed to create mirror image LV. "

View File

@ -53,7 +53,6 @@ int vg_add_snapshot(struct volume_group *vg, const char *name,
struct logical_volume *cow, union lvid *lvid, struct logical_volume *cow, union lvid *lvid,
uint32_t extent_count, uint32_t chunk_size) uint32_t extent_count, uint32_t chunk_size)
{ {
struct format_instance *fid = vg->fid;
struct logical_volume *snap; struct logical_volume *snap;
struct lv_segment *seg; struct lv_segment *seg;
@ -65,7 +64,7 @@ int vg_add_snapshot(struct volume_group *vg, const char *name,
return 0; return 0;
} }
if (!(snap = lv_create_empty(fid, name ? name : "snapshot%d", if (!(snap = lv_create_empty(name ? name : "snapshot%d",
lvid, LVM_READ | LVM_WRITE | VISIBLE_LV, lvid, LVM_READ | LVM_WRITE | VISIBLE_LV,
ALLOC_INHERIT, 1, origin->vg))) { ALLOC_INHERIT, 1, origin->vg))) {
stack; stack;

View File

@ -762,7 +762,7 @@ static int _lvcreate(struct cmd_context *cmd, struct lvcreate_params *lp)
} }
} }
if (!(lv = lv_create_empty(vg->fid, lv_name ? lv_name : "lvol%d", NULL, if (!(lv = lv_create_empty(lv_name ? lv_name : "lvol%d", NULL,
status, lp->alloc, 0, vg))) { status, lp->alloc, 0, vg))) {
stack; stack;
goto error; goto error;

View File

@ -119,7 +119,7 @@ static struct logical_volume *_set_up_pvmove_lv(struct cmd_context *cmd,
struct lv_list *lvl; struct lv_list *lvl;
/* FIXME Cope with non-contiguous => splitting existing segments */ /* FIXME Cope with non-contiguous => splitting existing segments */
if (!(lv_mirr = lv_create_empty(vg->fid, "pvmove%d", NULL, if (!(lv_mirr = lv_create_empty("pvmove%d", NULL,
LVM_READ | LVM_WRITE, LVM_READ | LVM_WRITE,
ALLOC_CONTIGUOUS, 0, vg))) { ALLOC_CONTIGUOUS, 0, vg))) {
log_error("Creation of temporary pvmove LV failed"); log_error("Creation of temporary pvmove LV failed");

View File

@ -1347,7 +1347,7 @@ struct logical_volume *create_mirror_log(struct cmd_context *cmd,
return NULL; return NULL;
} }
if (!(log_lv = lv_create_empty(vg->fid, log_name, NULL, if (!(log_lv = lv_create_empty(log_name, NULL,
VISIBLE_LV | LVM_READ | LVM_WRITE, VISIBLE_LV | LVM_READ | LVM_WRITE,
alloc, 0, vg))) { alloc, 0, vg))) {
stack; stack;