1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-18 10:04:20 +03:00

Thin add dev_manager_thin_pool_percent

dev manager function to read percent info from thin pool.
This commit is contained in:
Zdenek Kabelac 2011-12-21 13:09:33 +00:00
parent 2bc1d7598e
commit c0fcaacb8d
2 changed files with 27 additions and 0 deletions

View File

@ -872,6 +872,30 @@ static int _belong_to_vg(const char *vgname, const char *name)
#endif
int dev_manager_thin_pool_percent(struct dev_manager *dm,
const struct logical_volume *lv,
percent_t *percent)
{
char *name;
const char *dlid;
/*
* Build a name for the top layer.
*/
if (!(name = dm_build_dm_name(dm->mem, lv->vg->name, lv->name, thin_layer)))
return_0;
if (!(dlid = build_dm_uuid(dm->mem, lv->lvid.s, thin_layer)))
return_0;
log_debug("Getting device status percentage for %s", name);
if (!(_percent(dm, name, dlid, "thin-pool", 0, NULL, percent,
NULL, 1)))
return_0;
return 1;
}
/*************************/
/* NEW CODE STARTS HERE */
/*************************/

View File

@ -52,6 +52,9 @@ int dev_manager_snapshot_percent(struct dev_manager *dm,
int dev_manager_mirror_percent(struct dev_manager *dm,
const struct logical_volume *lv, int wait,
percent_t *percent, uint32_t *event_nr);
int dev_manager_thin_pool_percent(struct dev_manager *dm,
const struct logical_volume *lv,
percent_t *percent);
int dev_manager_suspend(struct dev_manager *dm, struct logical_volume *lv,
struct lv_activate_opts *laopts, int lockfs, int flush_required);
int dev_manager_activate(struct dev_manager *dm, struct logical_volume *lv,