mirror of
git://sourceware.org/git/lvm2.git
synced 2025-03-10 16:58:47 +03:00
Thin add lv_thin_pool_percent
This commit is contained in:
parent
c0fcaacb8d
commit
34507894e9
@ -689,6 +689,30 @@ int lv_raid_percent(const struct logical_volume *lv, percent_t *percent)
|
|||||||
return lv_mirror_percent(lv->vg->cmd, lv, 0, percent, NULL);
|
return lv_mirror_percent(lv->vg->cmd, lv, 0, percent, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Returns 1 if percent set, else 0 on failure.
|
||||||
|
*/
|
||||||
|
int lv_thin_pool_percent(const struct logical_volume *lv, percent_t *percent)
|
||||||
|
{
|
||||||
|
int r;
|
||||||
|
struct dev_manager *dm;
|
||||||
|
|
||||||
|
if (!activation())
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
log_debug("Checking thin pool percent for LV %s/%s", lv->vg->name, lv->name);
|
||||||
|
|
||||||
|
if (!(dm = dev_manager_create(lv->vg->cmd, lv->vg->name, 1)))
|
||||||
|
return_0;
|
||||||
|
|
||||||
|
if (!(r = dev_manager_thin_pool_percent(dm, lv, percent)))
|
||||||
|
stack;
|
||||||
|
|
||||||
|
dev_manager_destroy(dm);
|
||||||
|
|
||||||
|
return r;
|
||||||
|
}
|
||||||
|
|
||||||
static int _lv_active(struct cmd_context *cmd, struct logical_volume *lv)
|
static int _lv_active(struct cmd_context *cmd, struct logical_volume *lv)
|
||||||
{
|
{
|
||||||
struct lvinfo info;
|
struct lvinfo info;
|
||||||
|
@ -100,6 +100,7 @@ int lv_snapshot_percent(const struct logical_volume *lv, percent_t *percent);
|
|||||||
int lv_mirror_percent(struct cmd_context *cmd, const struct logical_volume *lv,
|
int lv_mirror_percent(struct cmd_context *cmd, const struct logical_volume *lv,
|
||||||
int wait, percent_t *percent, uint32_t *event_nr);
|
int wait, percent_t *percent, uint32_t *event_nr);
|
||||||
int lv_raid_percent(const struct logical_volume *lv, percent_t *percent);
|
int lv_raid_percent(const struct logical_volume *lv, percent_t *percent);
|
||||||
|
int lv_thin_pool_percent(const struct logical_volume *lv, percent_t *percent);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Return number of LVs in the VG that are active.
|
* Return number of LVs in the VG that are active.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user