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

Document return codes.

This commit is contained in:
Alasdair Kergon 2002-02-11 17:42:02 +00:00
parent 6d52fb460b
commit a62ee8ad27
2 changed files with 17 additions and 4 deletions

View File

@ -62,6 +62,11 @@ static int _query(struct logical_volume *lv, int (*fn)(const char *))
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)
{
return _query(lv, device_active);
@ -77,6 +82,10 @@ int lv_open_count(struct logical_volume *lv)
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)
{
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), "",
lv->vg->name, lv->name)) {
stack;
return -1;
return 0;
}
return device_info(buffer, info);

View File

@ -13,11 +13,15 @@ int driver_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_suspended(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);
/*
@ -42,12 +46,12 @@ int lv_update_write_access(struct logical_volume *lv);
/*
* 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);
/*
* 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);