1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

o dev_manager_suspend, untested.

This commit is contained in:
Joe Thornber 2002-03-14 10:56:09 +00:00
parent 6eb746e187
commit d8e7d77316
2 changed files with 35 additions and 1 deletions

View File

@ -584,6 +584,40 @@ int dev_manager_info(struct dev_manager *dm, struct logical_volume *lv,
return 1;
}
int dev_manager_suspend(struct dev_manager *dm, struct logical_volume *lv)
{
char *name;
struct dm_info info;
/*
* Build a name for the top layer.
*/
if (!(name = _build_name(dm->mem, lv->vg->name, lv->name, NULL))) {
stack;
return 0;
}
/*
* Try and get some info on this device.
*/
if (!_info(name, &info)) {
stack;
return 0;
}
if (!info.exists) {
log_warn("No such device '%s'.", lv->name);
return 0;
}
if (!info.suspended && !_suspend_or_resume(name, 1)) {
stack;
return 0;
}
return 1;
}
static struct dev_layer *_create_dev(struct pool *mem,
char *name,
struct logical_volume *lv)

View File

@ -27,7 +27,7 @@ void dev_manager_destroy(struct dev_manager *dm);
*/
int dev_manager_info(struct dev_manager *dm, struct logical_volume *lv,
struct dm_info *info);
int dev_manager_suspend(struct dev_manager *dm, struct logical_volume *lv);
int dev_manager_activate(struct dev_manager *dm, struct logical_volume *lv);
int dev_manager_deactivate(struct dev_manager *dm, struct logical_volume *lv);