@@ -108,7 +108,7 @@ static unsigned int mdp_major(void)
108
108
n = strtol (line , & p , 10 );
109
109
if (errno == ERANGE || n < INT_MIN || n > INT_MAX ) {
110
110
fprintf (stderr ,
111
- "Error: mdp device numner is out of range.\n" );
111
+ "Error: mdp device numner is out of range.\n" );
112
112
exit (1 );
113
113
}
114
114
major_no = (unsigned int ) n ;
@@ -127,7 +127,7 @@ static unsigned int mdp_major(void)
127
127
128
128
if (!found ) {
129
129
fprintf (stderr ,
130
- "Error: mdp devices detected but no mdp device found!\n" );
130
+ "Error: mdp devices detected but no mdp device found!\n" );
131
131
exit (1 );
132
132
}
133
133
@@ -173,58 +173,58 @@ static int md_setup(char *str)
173
173
str1 = str ;
174
174
if (minor_num < 0 ) {
175
175
fprintf (stderr , "md: md=%d, Minor device number must be positive.\n" ,
176
- minor_num );
176
+ minor_num );
177
177
return 0 ;
178
178
}
179
179
if (minor_num >= MAX_MD_DEVS ) {
180
180
fprintf (stderr , "md: md=%d, Minor device number too high.\n" ,
181
- minor_num );
181
+ minor_num );
182
182
return 0 ;
183
183
}
184
184
for (ent = 0 ; ent < md_setup_ents ; ent ++ )
185
185
if (md_setup_args [ent ].minor == (unsigned ) minor_num &&
186
186
md_setup_args [ent ].partitioned == partitioned ) {
187
187
fprintf (stderr ,
188
- "md: md=%s%d, Specified more than once. "
189
- "Replacing previous definition.\n" ,
190
- partitioned ? "d" : "" , minor_num );
188
+ "md: md=%s%d, Specified more than once. "
189
+ "Replacing previous definition.\n" ,
190
+ partitioned ? "d" : "" , minor_num );
191
191
break ;
192
192
}
193
193
if (ent >= MAX_MD_DEVS ) {
194
194
fprintf (stderr , "md: md=%s%d - too many md initialisations\n" ,
195
- partitioned ? "d" : "" , minor_num );
195
+ partitioned ? "d" : "" , minor_num );
196
196
return 0 ;
197
197
}
198
198
if (ent >= md_setup_ents )
199
199
md_setup_ents ++ ;
200
200
switch (get_option (& str , & level )) { /* RAID level */
201
- case 2 : /* could be 0 or -1.. */
202
- if (level == 0 || level == LEVEL_LINEAR ) {
203
- if (get_option (& str , & factor ) != 2 || /* Chunk Size */
204
- get_option (& str , & fault ) != 2 ) {
205
- fprintf (stderr ,
206
- "md: Too few arguments supplied to md=.\n" );
207
- return 0 ;
201
+ case 2 : /* could be 0 or -1.. */
202
+ if (level == 0 || level == LEVEL_LINEAR ) {
203
+ if (get_option (& str , & factor ) != 2 || /* Chunk Size */
204
+ get_option (& str , & fault ) != 2 ) {
205
+ fprintf (stderr ,
206
+ "md: Too few arguments supplied to md=.\n" );
207
+ return 0 ;
208
+ }
209
+ md_setup_args [ent ].level = level ;
210
+ md_setup_args [ent ].chunk = 1 << (factor + 12 );
211
+ if (level == LEVEL_LINEAR )
212
+ pername = "linear" ;
213
+ else
214
+ pername = "raid0" ;
215
+ break ;
208
216
}
209
- md_setup_args [ent ].level = level ;
210
- md_setup_args [ent ].chunk = 1 << (factor + 12 );
211
- if (level == LEVEL_LINEAR )
212
- pername = "linear" ;
213
- else
214
- pername = "raid0" ;
215
- break ;
216
- }
217
217
/* FALL THROUGH */
218
- case 1 : /* the first device is numeric */
219
- str = str1 ;
218
+ case 1 : /* the first device is numeric */
219
+ str = str1 ;
220
220
/* FALL THROUGH */
221
- case 0 :
222
- md_setup_args [ent ].level = LEVEL_NONE ;
223
- pername = "super-block" ;
221
+ case 0 :
222
+ md_setup_args [ent ].level = LEVEL_NONE ;
223
+ pername = "super-block" ;
224
224
}
225
225
226
226
fprintf (stderr , "md: Will configure md%s%d (%s) from %s, below.\n" ,
227
- partitioned ? "_d" : "" , minor_num , pername , str );
227
+ partitioned ? "_d" : "" , minor_num , pername , str );
228
228
md_setup_args [ent ].device_names = str ;
229
229
md_setup_args [ent ].partitioned = partitioned ;
230
230
md_setup_args [ent ].minor = (unsigned ) minor_num ;
@@ -254,7 +254,7 @@ static void md_setup_drive(void)
254
254
devname = md_setup_args [ent ].device_names ;
255
255
256
256
snprintf (name , sizeof name ,
257
- "/dev/md%s%d" , partitioned ? "_d" : "" , dev_minor );
257
+ "/dev/md%s%d" , partitioned ? "_d" : "" , dev_minor );
258
258
259
259
if (stat (name , & st_chk ) == 0 )
260
260
continue ;
@@ -274,7 +274,7 @@ static void md_setup_drive(void)
274
274
dev = name_to_dev_t (devname );
275
275
if (!dev ) {
276
276
fprintf (stderr , "md: Unknown device name: %s\n" ,
277
- devname );
277
+ devname );
278
278
break ;
279
279
}
280
280
@@ -288,19 +288,19 @@ static void md_setup_drive(void)
288
288
continue ;
289
289
290
290
fprintf (stderr , "md: Loading md%s%d: %s\n" ,
291
- partitioned ? "_d" : "" , dev_minor ,
292
- md_setup_args [ent ].device_names );
291
+ partitioned ? "_d" : "" , dev_minor ,
292
+ md_setup_args [ent ].device_names );
293
293
294
294
fd = open (name , 0 , 0 );
295
295
if (fd < 0 ) {
296
296
fprintf (stderr , "md: open failed - cannot start "
297
- "array %s\n" , name );
297
+ "array %s\n" , name );
298
298
continue ;
299
299
}
300
300
if (ioctl (fd , SET_ARRAY_INFO , 0 ) == - EBUSY ) {
301
301
fprintf (stderr ,
302
- "md: Ignoring md=%d, already autodetected. (Use raid=noautodetect)\n" ,
303
- dev_minor );
302
+ "md: Ignoring md=%d, already autodetected. (Use raid=noautodetect)\n" ,
303
+ dev_minor );
304
304
close (fd );
305
305
continue ;
306
306
}
@@ -328,7 +328,7 @@ static void md_setup_drive(void)
328
328
dinfo .number = i ;
329
329
dinfo .raid_disk = i ;
330
330
dinfo .state =
331
- (1 << MD_DISK_ACTIVE ) | (1 << MD_DISK_SYNC );
331
+ (1 << MD_DISK_ACTIVE ) | (1 << MD_DISK_SYNC );
332
332
dinfo .major = (int ) major (dev );
333
333
dinfo .minor = (int ) minor (dev );
334
334
err = ioctl (fd , ADD_NEW_DISK , & dinfo );
@@ -348,7 +348,7 @@ static void md_setup_drive(void)
348
348
err = ioctl (fd , RUN_ARRAY , 0 );
349
349
if (err )
350
350
fprintf (stderr , "md: starting md%d failed\n" ,
351
- dev_minor );
351
+ dev_minor );
352
352
else {
353
353
/* reread the partition table.
354
354
* I (neilb) and not sure why this is needed, but I
@@ -394,7 +394,7 @@ static void md_run_setup(void)
394
394
create_dev ("/dev/md0" , makedev (MD_MAJOR , 0 ));
395
395
if (raid_noautodetect )
396
396
fprintf (stderr ,
397
- "md: Skipping autodetection of RAID arrays. (raid=noautodetect)\n" );
397
+ "md: Skipping autodetection of RAID arrays. (raid=noautodetect)\n" );
398
398
else {
399
399
int fd = open ("/dev/md0" , 0 , 0 );
400
400
if (fd >= 0 ) {
0 commit comments