aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/raid0.c
diff options
context:
space:
mode:
authorAndre Noll <maan@systemlinux.org>2009-01-08 16:31:07 -0500
committerNeilBrown <neilb@suse.de>2009-01-08 16:31:07 -0500
commit0825b87a7dd9645c7e16489fec839a3cb5c40a08 (patch)
tree35c009c01470ce79fd1bc93d19c5bdb6b2a3b761 /drivers/md/raid0.c
parent6b8796cc3decb43c7c67a13a0699b6a21b754c78 (diff)
md: raid0 create_strip_zones(): Add KERN_INFO/KERN_ERR to printk's.
This patch consists only of these trivial changes. Signed-off-by: Andre Noll <maan@systemlinux.org> Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md/raid0.c')
-rw-r--r--drivers/md/raid0.c46
1 files changed, 25 insertions, 21 deletions
diff --git a/drivers/md/raid0.c b/drivers/md/raid0.c
index 9074ea43d523..c759436b5d84 100644
--- a/drivers/md/raid0.c
+++ b/drivers/md/raid0.c
@@ -68,18 +68,18 @@ static int create_strip_zones (mddev_t *mddev)
68 conf->nr_strip_zones = 0; 68 conf->nr_strip_zones = 0;
69 69
70 rdev_for_each(rdev1, tmp1, mddev) { 70 rdev_for_each(rdev1, tmp1, mddev) {
71 printk("raid0: looking at %s\n", 71 printk(KERN_INFO "raid0: looking at %s\n",
72 bdevname(rdev1->bdev,b)); 72 bdevname(rdev1->bdev,b));
73 c = 0; 73 c = 0;
74 rdev_for_each(rdev2, tmp2, mddev) { 74 rdev_for_each(rdev2, tmp2, mddev) {
75 printk("raid0: comparing %s(%llu)", 75 printk(KERN_INFO "raid0: comparing %s(%llu)",
76 bdevname(rdev1->bdev,b), 76 bdevname(rdev1->bdev,b),
77 (unsigned long long)rdev1->size); 77 (unsigned long long)rdev1->size);
78 printk(" with %s(%llu)\n", 78 printk(KERN_INFO " with %s(%llu)\n",
79 bdevname(rdev2->bdev,b), 79 bdevname(rdev2->bdev,b),
80 (unsigned long long)rdev2->size); 80 (unsigned long long)rdev2->size);
81 if (rdev2 == rdev1) { 81 if (rdev2 == rdev1) {
82 printk("raid0: END\n"); 82 printk(KERN_INFO "raid0: END\n");
83 break; 83 break;
84 } 84 }
85 if (rdev2->size == rdev1->size) 85 if (rdev2->size == rdev1->size)
@@ -88,19 +88,20 @@ static int create_strip_zones (mddev_t *mddev)
88 * Not unique, don't count it as a new 88 * Not unique, don't count it as a new
89 * group 89 * group
90 */ 90 */
91 printk("raid0: EQUAL\n"); 91 printk(KERN_INFO "raid0: EQUAL\n");
92 c = 1; 92 c = 1;
93 break; 93 break;
94 } 94 }
95 printk("raid0: NOT EQUAL\n"); 95 printk(KERN_INFO "raid0: NOT EQUAL\n");
96 } 96 }
97 if (!c) { 97 if (!c) {
98 printk("raid0: ==> UNIQUE\n"); 98 printk(KERN_INFO "raid0: ==> UNIQUE\n");
99 conf->nr_strip_zones++; 99 conf->nr_strip_zones++;
100 printk("raid0: %d zones\n", conf->nr_strip_zones); 100 printk(KERN_INFO "raid0: %d zones\n",
101 conf->nr_strip_zones);
101 } 102 }
102 } 103 }
103 printk("raid0: FINAL %d zones\n", conf->nr_strip_zones); 104 printk(KERN_INFO "raid0: FINAL %d zones\n", conf->nr_strip_zones);
104 105
105 conf->strip_zone = kzalloc(sizeof(struct strip_zone)* 106 conf->strip_zone = kzalloc(sizeof(struct strip_zone)*
106 conf->nr_strip_zones, GFP_KERNEL); 107 conf->nr_strip_zones, GFP_KERNEL);
@@ -123,12 +124,13 @@ static int create_strip_zones (mddev_t *mddev)
123 int j = rdev1->raid_disk; 124 int j = rdev1->raid_disk;
124 125
125 if (j < 0 || j >= mddev->raid_disks) { 126 if (j < 0 || j >= mddev->raid_disks) {
126 printk("raid0: bad disk number %d - aborting!\n", j); 127 printk(KERN_ERR "raid0: bad disk number %d - "
128 "aborting!\n", j);
127 goto abort; 129 goto abort;
128 } 130 }
129 if (zone->dev[j]) { 131 if (zone->dev[j]) {
130 printk("raid0: multiple devices for %d - aborting!\n", 132 printk(KERN_ERR "raid0: multiple devices for %d - "
131 j); 133 "aborting!\n", j);
132 goto abort; 134 goto abort;
133 } 135 }
134 zone->dev[j] = rdev1; 136 zone->dev[j] = rdev1;
@@ -149,8 +151,8 @@ static int create_strip_zones (mddev_t *mddev)
149 cnt++; 151 cnt++;
150 } 152 }
151 if (cnt != mddev->raid_disks) { 153 if (cnt != mddev->raid_disks) {
152 printk("raid0: too few disks (%d of %d) - aborting!\n", 154 printk(KERN_ERR "raid0: too few disks (%d of %d) - "
153 cnt, mddev->raid_disks); 155 "aborting!\n", cnt, mddev->raid_disks);
154 goto abort; 156 goto abort;
155 } 157 }
156 zone->nb_dev = cnt; 158 zone->nb_dev = cnt;
@@ -166,7 +168,7 @@ static int create_strip_zones (mddev_t *mddev)
166 zone = conf->strip_zone + i; 168 zone = conf->strip_zone + i;
167 zone->dev = conf->strip_zone[i-1].dev + mddev->raid_disks; 169 zone->dev = conf->strip_zone[i-1].dev + mddev->raid_disks;
168 170
169 printk("raid0: zone %d\n", i); 171 printk(KERN_INFO "raid0: zone %d\n", i);
170 zone->dev_start = current_start; 172 zone->dev_start = current_start;
171 smallest = NULL; 173 smallest = NULL;
172 c = 0; 174 c = 0;
@@ -174,23 +176,25 @@ static int create_strip_zones (mddev_t *mddev)
174 for (j=0; j<cnt; j++) { 176 for (j=0; j<cnt; j++) {
175 char b[BDEVNAME_SIZE]; 177 char b[BDEVNAME_SIZE];
176 rdev = conf->strip_zone[0].dev[j]; 178 rdev = conf->strip_zone[0].dev[j];
177 printk("raid0: checking %s ...", bdevname(rdev->bdev,b)); 179 printk(KERN_INFO "raid0: checking %s ...",
180 bdevname(rdev->bdev, b));
178 if (rdev->size > current_start / 2) { 181 if (rdev->size > current_start / 2) {
179 printk(" contained as device %d\n", c); 182 printk(KERN_INFO " contained as device %d\n",
183 c);
180 zone->dev[c] = rdev; 184 zone->dev[c] = rdev;
181 c++; 185 c++;
182 if (!smallest || (rdev->size <smallest->size)) { 186 if (!smallest || (rdev->size <smallest->size)) {
183 smallest = rdev; 187 smallest = rdev;
184 printk(" (%llu) is smallest!.\n", 188 printk(KERN_INFO " (%llu) is smallest!.\n",
185 (unsigned long long)rdev->size); 189 (unsigned long long)rdev->size);
186 } 190 }
187 } else 191 } else
188 printk(" nope.\n"); 192 printk(KERN_INFO " nope.\n");
189 } 193 }
190 194
191 zone->nb_dev = c; 195 zone->nb_dev = c;
192 zone->size = (smallest->size - current_start / 2) * c; 196 zone->size = (smallest->size - current_start / 2) * c;
193 printk("raid0: zone->nb_dev: %d, size: %llu\n", 197 printk(KERN_INFO "raid0: zone->nb_dev: %d, size: %llu\n",
194 zone->nb_dev, (unsigned long long)zone->size); 198 zone->nb_dev, (unsigned long long)zone->size);
195 199
196 zone->zone_start = curr_zone_start; 200 zone->zone_start = curr_zone_start;
@@ -226,7 +230,7 @@ static int create_strip_zones (mddev_t *mddev)
226 mddev->queue->backing_dev_info.congested_fn = raid0_congested; 230 mddev->queue->backing_dev_info.congested_fn = raid0_congested;
227 mddev->queue->backing_dev_info.congested_data = mddev; 231 mddev->queue->backing_dev_info.congested_data = mddev;
228 232
229 printk("raid0: done.\n"); 233 printk(KERN_INFO "raid0: done.\n");
230 return 0; 234 return 0;
231 abort: 235 abort:
232 return 1; 236 return 1;