mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-19 14:04:17 +03:00
Document return codes.
This commit is contained in:
parent
6d52fb460b
commit
a62ee8ad27
@ -62,6 +62,11 @@ static int _query(struct logical_volume *lv, int (*fn)(const char *))
|
|||||||
return fn(buffer);
|
return fn(buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* These three functions return the number of LVs in the state,
|
||||||
|
* or -1 on error.
|
||||||
|
*/
|
||||||
int lv_active(struct logical_volume *lv)
|
int lv_active(struct logical_volume *lv)
|
||||||
{
|
{
|
||||||
return _query(lv, device_active);
|
return _query(lv, device_active);
|
||||||
@ -77,6 +82,10 @@ int lv_open_count(struct logical_volume *lv)
|
|||||||
return _query(lv, device_open_count);
|
return _query(lv, device_open_count);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Returns 1 if info structure populated, else 0 on failure.
|
||||||
|
*/
|
||||||
int lv_info(struct logical_volume *lv, struct dm_info *info)
|
int lv_info(struct logical_volume *lv, struct dm_info *info)
|
||||||
{
|
{
|
||||||
char buffer[128];
|
char buffer[128];
|
||||||
@ -84,7 +93,7 @@ int lv_info(struct logical_volume *lv, struct dm_info *info)
|
|||||||
if (!build_dm_name(buffer, sizeof(buffer), "",
|
if (!build_dm_name(buffer, sizeof(buffer), "",
|
||||||
lv->vg->name, lv->name)) {
|
lv->vg->name, lv->name)) {
|
||||||
stack;
|
stack;
|
||||||
return -1;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
return device_info(buffer, info);
|
return device_info(buffer, info);
|
||||||
|
@ -13,11 +13,15 @@ int driver_version(char *version, size_t size);
|
|||||||
int library_version(char *version, size_t size);
|
int library_version(char *version, size_t size);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Status functions.
|
* Status functions. Return count (0 upwards) or else -1 on error.
|
||||||
*/
|
*/
|
||||||
int lv_active(struct logical_volume *lv);
|
int lv_active(struct logical_volume *lv);
|
||||||
int lv_suspended(struct logical_volume *lv);
|
int lv_suspended(struct logical_volume *lv);
|
||||||
int lv_open_count(struct logical_volume *lv);
|
int lv_open_count(struct logical_volume *lv);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Returns 1 if info structure has been populated, else 0.
|
||||||
|
*/
|
||||||
int lv_info(struct logical_volume *lv, struct dm_info *info);
|
int lv_info(struct logical_volume *lv, struct dm_info *info);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -42,12 +46,12 @@ int lv_update_write_access(struct logical_volume *lv);
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Activate all LVs in the VG. Ignore any that are already
|
* Activate all LVs in the VG. Ignore any that are already
|
||||||
* active. Return number activated.
|
* active. Return number actually activated.
|
||||||
*/
|
*/
|
||||||
int activate_lvs_in_vg(struct volume_group *vg);
|
int activate_lvs_in_vg(struct volume_group *vg);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Deactivate all LVs in the VG
|
* Deactivate all LVs in the VG. Return number actually deactivated.
|
||||||
*/
|
*/
|
||||||
int deactivate_lvs_in_vg(struct volume_group *vg);
|
int deactivate_lvs_in_vg(struct volume_group *vg);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user