diff options
Diffstat (limited to 'fs/jffs2/erase.c')
-rw-r--r-- | fs/jffs2/erase.c | 36 |
1 files changed, 22 insertions, 14 deletions
diff --git a/fs/jffs2/erase.c b/fs/jffs2/erase.c index ee1cd98fdbf2..5f14309a1faf 100644 --- a/fs/jffs2/erase.c +++ b/fs/jffs2/erase.c | |||
@@ -51,7 +51,7 @@ static void jffs2_erase_block(struct jffs2_sb_info *c, | |||
51 | jeb->offset, jeb->offset, jeb->offset + c->sector_size); | 51 | jeb->offset, jeb->offset, jeb->offset + c->sector_size); |
52 | instr = kmalloc(sizeof(struct erase_info) + sizeof(struct erase_priv_struct), GFP_KERNEL); | 52 | instr = kmalloc(sizeof(struct erase_info) + sizeof(struct erase_priv_struct), GFP_KERNEL); |
53 | if (!instr) { | 53 | if (!instr) { |
54 | printk(KERN_WARNING "kmalloc for struct erase_info in jffs2_erase_block failed. Refiling block for later\n"); | 54 | pr_warn("kmalloc for struct erase_info in jffs2_erase_block failed. Refiling block for later\n"); |
55 | mutex_lock(&c->erase_free_sem); | 55 | mutex_lock(&c->erase_free_sem); |
56 | spin_lock(&c->erase_completion_lock); | 56 | spin_lock(&c->erase_completion_lock); |
57 | list_move(&jeb->list, &c->erase_pending_list); | 57 | list_move(&jeb->list, &c->erase_pending_list); |
@@ -99,9 +99,11 @@ static void jffs2_erase_block(struct jffs2_sb_info *c, | |||
99 | } | 99 | } |
100 | 100 | ||
101 | if (ret == -EROFS) | 101 | if (ret == -EROFS) |
102 | printk(KERN_WARNING "Erase at 0x%08x failed immediately: -EROFS. Is the sector locked?\n", jeb->offset); | 102 | pr_warn("Erase at 0x%08x failed immediately: -EROFS. Is the sector locked?\n", |
103 | jeb->offset); | ||
103 | else | 104 | else |
104 | printk(KERN_WARNING "Erase at 0x%08x failed immediately: errno %d\n", jeb->offset, ret); | 105 | pr_warn("Erase at 0x%08x failed immediately: errno %d\n", |
106 | jeb->offset, ret); | ||
105 | 107 | ||
106 | jffs2_erase_failed(c, jeb, bad_offset); | 108 | jffs2_erase_failed(c, jeb, bad_offset); |
107 | } | 109 | } |
@@ -217,7 +219,7 @@ static void jffs2_erase_callback(struct erase_info *instr) | |||
217 | struct erase_priv_struct *priv = (void *)instr->priv; | 219 | struct erase_priv_struct *priv = (void *)instr->priv; |
218 | 220 | ||
219 | if(instr->state != MTD_ERASE_DONE) { | 221 | if(instr->state != MTD_ERASE_DONE) { |
220 | printk(KERN_WARNING "Erase at 0x%08llx finished, but state != MTD_ERASE_DONE. State is 0x%x instead.\n", | 222 | pr_warn("Erase at 0x%08llx finished, but state != MTD_ERASE_DONE. State is 0x%x instead.\n", |
221 | (unsigned long long)instr->addr, instr->state); | 223 | (unsigned long long)instr->addr, instr->state); |
222 | jffs2_erase_failed(priv->c, priv->jeb, instr->fail_addr); | 224 | jffs2_erase_failed(priv->c, priv->jeb, instr->fail_addr); |
223 | } else { | 225 | } else { |
@@ -284,7 +286,7 @@ static inline void jffs2_remove_node_refs_from_ino_list(struct jffs2_sb_info *c, | |||
284 | 286 | ||
285 | printk(KERN_DEBUG); | 287 | printk(KERN_DEBUG); |
286 | while(this) { | 288 | while(this) { |
287 | printk(KERN_CONT "0x%08x(%d)->", | 289 | pr_cont("0x%08x(%d)->", |
288 | ref_offset(this), ref_flags(this)); | 290 | ref_offset(this), ref_flags(this)); |
289 | if (++i == 5) { | 291 | if (++i == 5) { |
290 | printk(KERN_DEBUG); | 292 | printk(KERN_DEBUG); |
@@ -292,7 +294,7 @@ static inline void jffs2_remove_node_refs_from_ino_list(struct jffs2_sb_info *c, | |||
292 | } | 294 | } |
293 | this = this->next_in_ino; | 295 | this = this->next_in_ino; |
294 | } | 296 | } |
295 | printk(KERN_CONT "\n"); | 297 | pr_cont("\n"); |
296 | }); | 298 | }); |
297 | 299 | ||
298 | switch (ic->class) { | 300 | switch (ic->class) { |
@@ -364,8 +366,10 @@ static int jffs2_block_check_erase(struct jffs2_sb_info *c, struct jffs2_erasebl | |||
364 | } while(--retlen); | 366 | } while(--retlen); |
365 | mtd_unpoint(c->mtd, jeb->offset, c->sector_size); | 367 | mtd_unpoint(c->mtd, jeb->offset, c->sector_size); |
366 | if (retlen) { | 368 | if (retlen) { |
367 | printk(KERN_WARNING "Newly-erased block contained word 0x%lx at offset 0x%08tx\n", | 369 | pr_warn("Newly-erased block contained word 0x%lx at offset 0x%08tx\n", |
368 | *wordebuf, jeb->offset + c->sector_size-retlen*sizeof(*wordebuf)); | 370 | *wordebuf, |
371 | jeb->offset + | ||
372 | c->sector_size-retlen * sizeof(*wordebuf)); | ||
369 | return -EIO; | 373 | return -EIO; |
370 | } | 374 | } |
371 | return 0; | 375 | return 0; |
@@ -373,7 +377,8 @@ static int jffs2_block_check_erase(struct jffs2_sb_info *c, struct jffs2_erasebl | |||
373 | do_flash_read: | 377 | do_flash_read: |
374 | ebuf = kmalloc(PAGE_SIZE, GFP_KERNEL); | 378 | ebuf = kmalloc(PAGE_SIZE, GFP_KERNEL); |
375 | if (!ebuf) { | 379 | if (!ebuf) { |
376 | printk(KERN_WARNING "Failed to allocate page buffer for verifying erase at 0x%08x. Refiling\n", jeb->offset); | 380 | pr_warn("Failed to allocate page buffer for verifying erase at 0x%08x. Refiling\n", |
381 | jeb->offset); | ||
377 | return -EAGAIN; | 382 | return -EAGAIN; |
378 | } | 383 | } |
379 | 384 | ||
@@ -387,12 +392,14 @@ static int jffs2_block_check_erase(struct jffs2_sb_info *c, struct jffs2_erasebl | |||
387 | 392 | ||
388 | ret = mtd_read(c->mtd, ofs, readlen, &retlen, ebuf); | 393 | ret = mtd_read(c->mtd, ofs, readlen, &retlen, ebuf); |
389 | if (ret) { | 394 | if (ret) { |
390 | printk(KERN_WARNING "Read of newly-erased block at 0x%08x failed: %d. Putting on bad_list\n", ofs, ret); | 395 | pr_warn("Read of newly-erased block at 0x%08x failed: %d. Putting on bad_list\n", |
396 | ofs, ret); | ||
391 | ret = -EIO; | 397 | ret = -EIO; |
392 | goto fail; | 398 | goto fail; |
393 | } | 399 | } |
394 | if (retlen != readlen) { | 400 | if (retlen != readlen) { |
395 | printk(KERN_WARNING "Short read from newly-erased block at 0x%08x. Wanted %d, got %zd\n", ofs, readlen, retlen); | 401 | pr_warn("Short read from newly-erased block at 0x%08x. Wanted %d, got %zd\n", |
402 | ofs, readlen, retlen); | ||
396 | ret = -EIO; | 403 | ret = -EIO; |
397 | goto fail; | 404 | goto fail; |
398 | } | 405 | } |
@@ -401,7 +408,8 @@ static int jffs2_block_check_erase(struct jffs2_sb_info *c, struct jffs2_erasebl | |||
401 | unsigned long *datum = ebuf + i; | 408 | unsigned long *datum = ebuf + i; |
402 | if (*datum + 1) { | 409 | if (*datum + 1) { |
403 | *bad_offset += i; | 410 | *bad_offset += i; |
404 | printk(KERN_WARNING "Newly-erased block contained word 0x%lx at offset 0x%08x\n", *datum, *bad_offset); | 411 | pr_warn("Newly-erased block contained word 0x%lx at offset 0x%08x\n", |
412 | *datum, *bad_offset); | ||
405 | ret = -EIO; | 413 | ret = -EIO; |
406 | goto fail; | 414 | goto fail; |
407 | } | 415 | } |
@@ -456,10 +464,10 @@ static void jffs2_mark_erased_block(struct jffs2_sb_info *c, struct jffs2_eraseb | |||
456 | 464 | ||
457 | if (ret || retlen != sizeof(marker)) { | 465 | if (ret || retlen != sizeof(marker)) { |
458 | if (ret) | 466 | if (ret) |
459 | printk(KERN_WARNING "Write clean marker to block at 0x%08x failed: %d\n", | 467 | pr_warn("Write clean marker to block at 0x%08x failed: %d\n", |
460 | jeb->offset, ret); | 468 | jeb->offset, ret); |
461 | else | 469 | else |
462 | printk(KERN_WARNING "Short write to newly-erased block at 0x%08x: Wanted %zd, got %zd\n", | 470 | pr_warn("Short write to newly-erased block at 0x%08x: Wanted %zd, got %zd\n", |
463 | jeb->offset, sizeof(marker), retlen); | 471 | jeb->offset, sizeof(marker), retlen); |
464 | 472 | ||
465 | goto filebad; | 473 | goto filebad; |