freemyipod r134 - Code Review

Jump to: navigation, search
Repository:freemyipod
Revision:r133‎ | r134 | r135 >
Date:02:30, 14 August 2010
Author:theseven
Status:new
Tags:
Comment:
Make nandfsck actually realize that it succeeded, and make it's progress bar run a bit more fluently
Modified paths:
  • /embios/trunk/target/ipodnano2g/ftl.c (modified) (history)

Diff [purge]

Index: embios/trunk/target/ipodnano2g/ftl.c
@@ -2342,7 +2342,7 @@
23432343 if (count)
23442344 {
23452345 #ifdef HAVE_LCD
2346 - lcdconsole_progressbar(&progressbar, 0, count * ppb);
 2346+ lcdconsole_progressbar(&progressbar, 0, count * ppb * 2);
23472347 #endif
23482348 count = 0;
23492349 for (i = 0; i < ftl_nand_type->userblocks + 0x17; i++)
@@ -2349,8 +2349,11 @@
23502350 if (blk_type[i] == 2)
23512351 {
23522352 block = 0xffff;
2353 - for (j = 0; j < ftl_nand_type->pagesperblock * ftl_banks; j++)
 2353+ for (j = 0; j < ppb; j++)
23542354 {
 2355+#ifdef HAVE_LCD
 2356+ progressbar_setpos(&progressbar, count * ppb * 2 + j, false);
 2357+#endif
23552358 uint32_t ret = ftl_vfl_read(i * ppb + j, ftl_buffer,
23562359 &ftl_sparebuffer[0], 1, 0);
23572360 if (ret & 0x11F) continue;
@@ -2420,6 +2423,9 @@
24212424 }
24222425 for (j = 0; j < ppb; j++)
24232426 {
 2427+#ifdef HAVE_LCD
 2428+ progressbar_setpos(&progressbar, count * ppb * 2 + ppb + j, false);
 2429+#endif
24242430 memset(&ftl_sparebuffer[0], 0xFF, 0x40);
24252431 ftl_sparebuffer[0].user.lpn = block * ppb + j;
24262432 ftl_sparebuffer[0].user.usn = pageusn[j];
@@ -2431,9 +2437,6 @@
24322438 "(scattered page commit)!\n", i * ppb + j);
24332439 return 1;
24342440 }
2435 -#ifdef HAVE_LCD
2436 - progressbar_setpos(&progressbar, count * ppb + j, false);
2437 -#endif
24382441 }
24392442 if (ftl_map[block] != 0xffff) blk_type[ftl_map[block]] = 5;
24402443 blk_type[i] = 1;
@@ -2441,7 +2444,7 @@
24422445 }
24432446 else blk_type[i] = 5;
24442447 #ifdef HAVE_LCD
2445 - progressbar_setpos(&progressbar, ++count * ppb, false);
 2448+ progressbar_setpos(&progressbar, ++count * ppb * 2, false);
24462449 #endif
24472450 }
24482451 }
@@ -2501,6 +2504,7 @@
25022505 return 1;
25032506 }
25042507 ftl_store_ctrl_block_list();
 2508+ return 0;
25052509 }
25062510
25072511
@@ -2565,6 +2569,7 @@
25662570 cprintf(CONSOLE_BOOT, "FTL recovery finished. Trying to mount again...\n");
25672571 if (ftl_open() == 0)
25682572 {
 2573+ cprintf(CONSOLE_BOOT, "Mount succeeded.\n");
25692574 ftl_initialized = true;
25702575 return 0;
25712576 }