mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-03 05:18:29 +03:00
o Stuff
This commit is contained in:
parent
4daacc38cb
commit
d53f88d7af
@ -322,3 +322,21 @@ int lv_extend(struct logical_volume *lv, uint32_t extents,
|
|||||||
pool_free(cmd->mem, new_map);
|
pool_free(cmd->mem, new_map);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* FIXME: I don't like the way the lvh is passed in here - EJT */
|
||||||
|
int lv_remove(struct volume_group *vg, struct list *lvh)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
struct logical_volume *lv;
|
||||||
|
|
||||||
|
lv = &list_item(lvh, struct lv_list)->lv;
|
||||||
|
for (i = 0; i < lv->le_count; i++)
|
||||||
|
lv->map[i].pv->pe_allocated--;
|
||||||
|
|
||||||
|
vg->lv_count--;
|
||||||
|
vg->free_count += lv->le_count;
|
||||||
|
|
||||||
|
list_del(lvh);
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
@ -288,19 +288,3 @@ struct physical_volume *_find_pv(struct volume_group *vg, struct device *dev)
|
|||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
int lv_remove(struct volume_group *vg, struct list *lvh)
|
|
||||||
{
|
|
||||||
int i;
|
|
||||||
struct logical_volume *lv;
|
|
||||||
|
|
||||||
lv = &list_item(lvh, struct lv_list)->lv;
|
|
||||||
for (i = 0; i < lv->le_count; i++) {
|
|
||||||
lv->map[i].pv->pe_allocated--;
|
|
||||||
}
|
|
||||||
|
|
||||||
list_del(lvh);
|
|
||||||
vg->lv_count--;
|
|
||||||
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
@ -33,11 +33,14 @@
|
|||||||
#define CLUSTERED 0x00000400 /* VG */
|
#define CLUSTERED 0x00000400 /* VG */
|
||||||
#define SHARED 0x00000800 /* VG */
|
#define SHARED 0x00000800 /* VG */
|
||||||
|
|
||||||
#define ALLOC_SIMPLE 0x00001000 /* LVM */
|
/* FIXME: This should be an enum rather than a bitset,
|
||||||
|
remove from status - EJT */
|
||||||
|
#define ALLOC_SIMPLE 0x00001000 /* LV */
|
||||||
#define ALLOC_STRICT 0x00002000 /* LV */
|
#define ALLOC_STRICT 0x00002000 /* LV */
|
||||||
#define ALLOC_CONTIGUOUS 0x00004000 /* LV */
|
#define ALLOC_CONTIGUOUS 0x00004000 /* LV */
|
||||||
#define SNAPSHOT 0x00008000 /* LV */
|
|
||||||
#define SNAPSHOT_ORG 0x00010000 /* LV */
|
#define SNAPSHOT 0x00010000 /* LV */
|
||||||
|
#define SNAPSHOT_ORG 0x00020000 /* LV */
|
||||||
|
|
||||||
|
|
||||||
#define EXPORTED_TAG "PV_EXP" /* Identifier of exported PV */
|
#define EXPORTED_TAG "PV_EXP" /* Identifier of exported PV */
|
||||||
@ -244,6 +247,8 @@ int lv_reduce(struct logical_volume *lv, uint32_t extents);
|
|||||||
int lv_extend(struct logical_volume *lv,
|
int lv_extend(struct logical_volume *lv,
|
||||||
uint32_t extents, struct list *allocatable_pvs);
|
uint32_t extents, struct list *allocatable_pvs);
|
||||||
|
|
||||||
|
int lv_remove(struct volume_group *vg, struct list *lvh);
|
||||||
|
|
||||||
|
|
||||||
/* FIXME: Move to other files */
|
/* FIXME: Move to other files */
|
||||||
int id_eq(struct id *op1, struct id *op2);
|
int id_eq(struct id *op1, struct id *op2);
|
||||||
@ -254,8 +259,6 @@ int pv_remove(struct volume_group *vg, struct physical_volume *pv);
|
|||||||
struct physical_volume *pv_find(struct volume_group *vg,
|
struct physical_volume *pv_find(struct volume_group *vg,
|
||||||
const char *pv_name);
|
const char *pv_name);
|
||||||
|
|
||||||
/* Remove an LV from a given VG */
|
|
||||||
int lv_remove(struct volume_group *vg, struct list *lvh);
|
|
||||||
|
|
||||||
/* Find a PV within a given VG */
|
/* Find a PV within a given VG */
|
||||||
struct list *find_pv_in_vg(struct volume_group *vg, const char *pv_name);
|
struct list *find_pv_in_vg(struct volume_group *vg, const char *pv_name);
|
||||||
|
@ -44,6 +44,8 @@ int lvcreate(int argc, char **argv)
|
|||||||
|
|
||||||
if (strcmp(arg_str_value(contiguous_ARG, "n"), "n"))
|
if (strcmp(arg_str_value(contiguous_ARG, "n"), "n"))
|
||||||
status |= ALLOC_CONTIGUOUS;
|
status |= ALLOC_CONTIGUOUS;
|
||||||
|
else
|
||||||
|
status |= ALLOC_SIMPLE;
|
||||||
|
|
||||||
zero = strcmp(arg_str_value(zero_ARG, "y"), "n");
|
zero = strcmp(arg_str_value(zero_ARG, "y"), "n");
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user