diff options
Diffstat (limited to 'fs')
-rw-r--r-- | fs/jffs2/scan.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/fs/jffs2/scan.c b/fs/jffs2/scan.c index 46f870d1cc36..b632dddcb482 100644 --- a/fs/jffs2/scan.c +++ b/fs/jffs2/scan.c | |||
@@ -20,7 +20,7 @@ | |||
20 | #include "summary.h" | 20 | #include "summary.h" |
21 | #include "debug.h" | 21 | #include "debug.h" |
22 | 22 | ||
23 | #define DEFAULT_EMPTY_SCAN_SIZE 1024 | 23 | #define DEFAULT_EMPTY_SCAN_SIZE 256 |
24 | 24 | ||
25 | #define noisy_printk(noise, args...) do { \ | 25 | #define noisy_printk(noise, args...) do { \ |
26 | if (*(noise)) { \ | 26 | if (*(noise)) { \ |
@@ -435,7 +435,7 @@ static int jffs2_scan_eraseblock (struct jffs2_sb_info *c, struct jffs2_eraseblo | |||
435 | unsigned char *buf, uint32_t buf_size, struct jffs2_summary *s) { | 435 | unsigned char *buf, uint32_t buf_size, struct jffs2_summary *s) { |
436 | struct jffs2_unknown_node *node; | 436 | struct jffs2_unknown_node *node; |
437 | struct jffs2_unknown_node crcnode; | 437 | struct jffs2_unknown_node crcnode; |
438 | uint32_t ofs, prevofs; | 438 | uint32_t ofs, prevofs, max_ofs; |
439 | uint32_t hdr_crc, buf_ofs, buf_len; | 439 | uint32_t hdr_crc, buf_ofs, buf_len; |
440 | int err; | 440 | int err; |
441 | int noise = 0; | 441 | int noise = 0; |
@@ -550,12 +550,12 @@ static int jffs2_scan_eraseblock (struct jffs2_sb_info *c, struct jffs2_eraseblo | |||
550 | 550 | ||
551 | /* We temporarily use 'ofs' as a pointer into the buffer/jeb */ | 551 | /* We temporarily use 'ofs' as a pointer into the buffer/jeb */ |
552 | ofs = 0; | 552 | ofs = 0; |
553 | 553 | max_ofs = EMPTY_SCAN_SIZE(c->sector_size); | |
554 | /* Scan only 4KiB of 0xFF before declaring it's empty */ | 554 | /* Scan only EMPTY_SCAN_SIZE of 0xFF before declaring it's empty */ |
555 | while(ofs < EMPTY_SCAN_SIZE(c->sector_size) && *(uint32_t *)(&buf[ofs]) == 0xFFFFFFFF) | 555 | while(ofs < max_ofs && *(uint32_t *)(&buf[ofs]) == 0xFFFFFFFF) |
556 | ofs += 4; | 556 | ofs += 4; |
557 | 557 | ||
558 | if (ofs == EMPTY_SCAN_SIZE(c->sector_size)) { | 558 | if (ofs == max_ofs) { |
559 | #ifdef CONFIG_JFFS2_FS_WRITEBUFFER | 559 | #ifdef CONFIG_JFFS2_FS_WRITEBUFFER |
560 | if (jffs2_cleanmarker_oob(c)) { | 560 | if (jffs2_cleanmarker_oob(c)) { |
561 | /* scan oob, take care of cleanmarker */ | 561 | /* scan oob, take care of cleanmarker */ |