summaryrefslogtreecommitdiff
path: root/msg.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2012-07-09 17:14:16 +1000
committerNeilBrown <neilb@suse.de>2012-07-09 17:14:16 +1000
commite7b84f9d5029338980d99d04b479ce814d4c4fcb (patch)
treebdaf73fa67253446dc0c5faef9256971d35e4955 /msg.c
parent5187a385870950d779b6434b2d2982914367f638 (diff)
Introduce pr_err for printing error messages.
'pr_err("' is a lot shorter than 'fprintf(stderr, Name ": ' cont_err() is also available. Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'msg.c')
-rw-r--r--msg.c22
1 files changed, 9 insertions, 13 deletions
diff --git a/msg.c b/msg.c
index 44aad1f6..e531ef7c 100644
--- a/msg.c
+++ b/msg.c
@@ -310,9 +310,8 @@ int check_mdmon_version(char *container)
ver = version ? mdadm_version(version) : -1;
free(version);
if (ver < 3002000) {
- fprintf(stderr, Name
- ": mdmon instance for %s cannot be disabled\n",
- container);
+ pr_err("mdmon instance for %s cannot be disabled\n",
+ container);
return -1;
}
}
@@ -351,8 +350,7 @@ int block_monitor(char *container, const int freeze)
ent = mdstat_read(0, 0);
if (!ent) {
- fprintf(stderr, Name
- ": failed to read /proc/mdstat while disabling mdmon\n");
+ pr_err("failed to read /proc/mdstat while disabling mdmon\n");
return -1;
}
@@ -363,9 +361,8 @@ int block_monitor(char *container, const int freeze)
sysfs_free(sra);
sra = sysfs_read(-1, e->devnum, GET_VERSION);
if (!sra) {
- fprintf(stderr, Name
- ": failed to read sysfs for subarray%s\n",
- to_subarray(e, container));
+ pr_err("failed to read sysfs for subarray%s\n",
+ to_subarray(e, container));
break;
}
/* can't reshape an array that we can't monitor */
@@ -406,7 +403,7 @@ int block_monitor(char *container, const int freeze)
}
if (e) {
- fprintf(stderr, Name ": failed to freeze subarray%s\n",
+ pr_err("failed to freeze subarray%s\n",
to_subarray(e, container));
/* thaw the partially frozen container */
@@ -416,7 +413,7 @@ int block_monitor(char *container, const int freeze)
sysfs_free(sra);
sra = sysfs_read(-1, e2->devnum, GET_VERSION);
if (unblock_subarray(sra, freeze))
- fprintf(stderr, Name ": Failed to unfreeze %s\n", e2->dev);
+ pr_err("Failed to unfreeze %s\n", e2->dev);
}
ping_monitor(container); /* cleared frozen */
@@ -437,8 +434,7 @@ void unblock_monitor(char *container, const int unfreeze)
ent = mdstat_read(0, 0);
if (!ent) {
- fprintf(stderr, Name
- ": failed to read /proc/mdstat while unblocking container\n");
+ pr_err("failed to read /proc/mdstat while unblocking container\n");
return;
}
@@ -453,7 +449,7 @@ void unblock_monitor(char *container, const int unfreeze)
if (sra->array.level > 0)
to_ping++;
if (unblock_subarray(sra, unfreeze))
- fprintf(stderr, Name ": Failed to unfreeze %s\n", e->dev);
+ pr_err("Failed to unfreeze %s\n", e->dev);
}
if (to_ping)
ping_monitor(container);