diff options
author | Patrick Caulfield <pcaulfie@redhat.com> | 2001-12-06 09:58:51 +0000 |
---|---|---|
committer | Patrick Caulfield <pcaulfie@redhat.com> | 2001-12-06 09:58:51 +0000 |
commit | dd34a165a1e0e901e3e2b7f76ffa931af7fe2f01 (patch) | |
tree | 76098120893fd6bb9df1edf3cf05bd01f72710d4 | |
parent | b2a690572212279c18cbb146da1294ff6eebaafd (diff) | |
download | lvm2-dd34a165a1e0e901e3e2b7f76ffa931af7fe2f01.tar.gz |
Add an extra parameter to the unlock functions to tell the cluster not to reload
the metadata at unlock time. We use this if the command failed.
-rw-r--r-- | lib/cmgr/cmgr.c | 17 | ||||
-rw-r--r-- | lib/cmgr/cmgr.h | 6 |
2 files changed, 13 insertions, 10 deletions
diff --git a/lib/cmgr/cmgr.c b/lib/cmgr/cmgr.c index e7218a76f..8ef84983a 100644 --- a/lib/cmgr/cmgr.c +++ b/lib/cmgr/cmgr.c @@ -651,7 +651,7 @@ int lock_lvm(int suspend) } -int unlock_lvm() +int unlock_lvm(int cmd_status) { if (!clustered) { @@ -660,12 +660,13 @@ int unlock_lvm() } else { - return unlock_for_cluster('G', NULL, 0, suspended); + char cmd = (cmd_status==0)?'G':'g'; + return unlock_for_cluster(cmd, NULL, 0, suspended); } } -/* Lock a whole VOlume group and all its LVs */ +/* Lock a whole Volume group and all its LVs */ int lock_vg(struct volume_group *vg, int suspend) { int status; @@ -696,7 +697,7 @@ int lock_vg(struct volume_group *vg, int suspend) } -int unlock_vg(struct volume_group *vg) +int unlock_vg(struct volume_group *vg, int cmd_status) { if (!clustered) { @@ -705,7 +706,8 @@ int unlock_vg(struct volume_group *vg) } else { - return unlock_for_cluster('V', vg->name, strlen(vg->name)+1, suspended); + char cmd = (cmd_status==0)?'V':'v'; + return unlock_for_cluster(cmd, vg->name, strlen(vg->name)+1, suspended); } } @@ -743,7 +745,7 @@ int lock_lv(struct logical_volume *lv, int suspend) } -int unlock_lv(struct logical_volume *lv) +int unlock_lv(struct logical_volume *lv, int cmd_status) { char full_lv_name[strlen(lv->name)+strlen(lv->vg->name)+2]; @@ -756,7 +758,8 @@ int unlock_lv(struct logical_volume *lv) } else { - return unlock_for_cluster('L', full_lv_name, strlen(full_lv_name)+1, suspended); + char cmd = (cmd_status==0)?'L':'l'; + return unlock_for_cluster(cmd, full_lv_name, strlen(full_lv_name)+1, suspended); } } diff --git a/lib/cmgr/cmgr.h b/lib/cmgr/cmgr.h index e08f0e9e2..4aaf5f74a 100644 --- a/lib/cmgr/cmgr.h +++ b/lib/cmgr/cmgr.h @@ -29,13 +29,13 @@ extern int unlock_for_cluster(char scope, char *name, int namelen, int suspend); /* The "even higher-level" API that also copes with non-clustered environment. */ extern int lock_lvm(int suspend); -extern int unlock_lvm(void); +extern int unlock_lvm(int cmd_status); extern int lock_lv(struct logical_volume *lv, int suspend); -extern int unlock_lv(struct logical_volume *lv); +extern int unlock_lv(struct logical_volume *lv, int cmd_status); extern int lock_vg(struct volume_group *vg, int suspend); -extern int unlock_vg(struct volume_group *vg); +extern int unlock_vg(struct volume_group *vg, int cmd_status); /* The system must be locked by one of the above calls before using these */ |