summaryrefslogtreecommitdiff
path: root/Kill.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2012-07-09 17:18:09 +1000
committerNeilBrown <neilb@suse.de>2012-07-09 17:18:09 +1000
commitba728be72f4b3f0b5cf56d19670a5cf117b0e373 (patch)
tree11f8d0ab96533c6338e99a79091036d7b3464772 /Kill.c
parent9e33d55609251a75e6320996fbdea6c4a702560e (diff)
Convert 'quiet' to 'not verbose' in various places.
If we change some functions to accept 'verbose', where <0 means to be quiet, in place of 'quiet', then we will be able to merge 'quiet' and 'verbose' together for simplicity. Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'Kill.c')
-rw-r--r--Kill.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/Kill.c b/Kill.c
index a271b65c..6e426c0e 100644
--- a/Kill.c
+++ b/Kill.c
@@ -29,7 +29,7 @@
#include "md_u.h"
#include "md_p.h"
-int Kill(char *dev, struct supertype *st, int force, int quiet, int noexcl)
+int Kill(char *dev, struct supertype *st, int force, int verbose, int noexcl)
{
/*
* Nothing fancy about Kill. It just zeroes out a superblock
@@ -46,7 +46,7 @@ int Kill(char *dev, struct supertype *st, int force, int quiet, int noexcl)
noexcl = 1;
fd = open(dev, O_RDWR|(noexcl ? 0 : O_EXCL));
if (fd < 0) {
- if (!quiet)
+ if (verbose >= 0)
pr_err("Couldn't open %s for write - not zeroing\n",
dev);
return 2;
@@ -54,7 +54,7 @@ int Kill(char *dev, struct supertype *st, int force, int quiet, int noexcl)
if (st == NULL)
st = guess_super(fd);
if (st == NULL || st->ss->init_super == NULL) {
- if (!quiet)
+ if (verbose >= 0)
pr_err("Unrecognised md component device - %s\n", dev);
close(fd);
return 2;
@@ -65,12 +65,12 @@ int Kill(char *dev, struct supertype *st, int force, int quiet, int noexcl)
st->ss->free_super(st);
st->ss->init_super(st, NULL, 0, "", NULL, NULL);
if (st->ss->store_super(st, fd)) {
- if (!quiet)
+ if (verbose >= 0)
pr_err("Could not zero superblock on %s\n",
dev);
rv = 1;
} else if (rv) {
- if (!quiet)
+ if (verbose >= 0)
pr_err("superblock zeroed anyway\n");
rv = 0;
}
@@ -79,7 +79,7 @@ int Kill(char *dev, struct supertype *st, int force, int quiet, int noexcl)
return rv;
}
-int Kill_subarray(char *dev, char *subarray, int quiet)
+int Kill_subarray(char *dev, char *subarray, int verbose)
{
/* Delete a subarray out of a container, the subarry must be
* inactive. The subarray string must be a subarray index
@@ -95,19 +95,19 @@ int Kill_subarray(char *dev, char *subarray, int quiet)
memset(st, 0, sizeof(*st));
- fd = open_subarray(dev, subarray, st, quiet);
+ fd = open_subarray(dev, subarray, st, verbose < 0);
if (fd < 0)
return 2;
if (!st->ss->kill_subarray) {
- if (!quiet)
+ if (verbose >= 0)
pr_err("Operation not supported for %s metadata\n",
st->ss->name);
goto free_super;
}
if (is_subarray_active(subarray, st->devname)) {
- if (!quiet)
+ if (verbose >= 0)
pr_err("Subarray-%s still active, aborting\n",
subarray);
goto free_super;
@@ -119,7 +119,7 @@ int Kill_subarray(char *dev, char *subarray, int quiet)
/* ok we've found our victim, drop the axe */
rv = st->ss->kill_subarray(st);
if (rv) {
- if (!quiet)
+ if (verbose >= 0)
pr_err("Failed to delete subarray-%s from %s\n",
subarray, dev);
goto free_super;
@@ -131,7 +131,7 @@ int Kill_subarray(char *dev, char *subarray, int quiet)
else
st->ss->sync_metadata(st);
- if (!quiet)
+ if (verbose >= 0)
pr_err("Deleted subarray-%s from %s, UUIDs may have changed\n",
subarray, dev);