[maemo-commits] [maemo-commits] r17963 - in projects/haf/trunk/dosfstools/debian: . patches
From: subversion at stage.maemo.org subversion at stage.maemo.orgDate: Wed Apr 1 18:45:19 EEST 2009
- Previous message: [maemo-commits] r17962 - projects/haf/tags/ke-recv
- Next message: [maemo-commits] r17964 - projects/haf/tags/dosfstools
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Author: kihamala Date: 2009-04-01 18:45:18 +0300 (Wed, 01 Apr 2009) New Revision: 17963 Added: projects/haf/trunk/dosfstools/debian/patches/17-ignore-free-clusters.patch Modified: projects/haf/trunk/dosfstools/debian/changelog projects/haf/trunk/dosfstools/debian/patches/series Log: releasing Modified: projects/haf/trunk/dosfstools/debian/changelog =================================================================== --- projects/haf/trunk/dosfstools/debian/changelog 2009-04-01 15:44:14 UTC (rev 17962) +++ projects/haf/trunk/dosfstools/debian/changelog 2009-04-01 15:45:18 UTC (rev 17963) @@ -1,3 +1,9 @@ +dosfstools (3.0.1-1maemo3) unstable; urgency=low + + * Add patch from Leonid to add support for -I command line option. + + -- Kimmo Hämäläinen <kimmo.hamalainen at nokia.com> Wed, 1 Apr 2009 13:53:24 +0300 + dosfstools (3.0.1-1maemo2) unstable; urgency=low * Patches from Leonid for time-limited scan, osso-mem, and dosfsck exit code. Added: projects/haf/trunk/dosfstools/debian/patches/17-ignore-free-clusters.patch =================================================================== --- projects/haf/trunk/dosfstools/debian/patches/17-ignore-free-clusters.patch 2009-04-01 15:44:14 UTC (rev 17962) +++ projects/haf/trunk/dosfstools/debian/patches/17-ignore-free-clusters.patch 2009-04-01 15:45:18 UTC (rev 17963) @@ -0,0 +1,125 @@ +Index: dosfstools-3.0.1/src/dosfsck.c +=================================================================== +--- dosfstools-3.0.1/src/dosfsck.c 2009-04-01 10:59:54.000000000 +0300 ++++ dosfstools-3.0.1/src/dosfsck.c 2009-04-01 15:39:49.000000000 +0300 +@@ -72,6 +72,7 @@ + fprintf(stderr," -y same as -a, for compat with other *fsck\n"); + fprintf(stderr," -m Maemo addition: MBs to spare in the system under high threshold (default 0)\n"); + fprintf(stderr," -T secs Maemo addition: no-op time limited check for pointed duration\n"); ++ fprintf(stderr," -I Maemo addition: ignore trivial errors like 'Free Cluster Summary wrong'. Do not use with repair!\n"); + exit(2); + } + +@@ -112,12 +113,13 @@ + unsigned n_files_check=0, n_files_verify=0; + unsigned long free_clusters; + int megs_to_spare = 0; ++ int skip_trivial_errors = 0; + + rw = salvage_files = verify = 0; + interactive = 1; + check_atari(); + +- while ((c = getopt(argc,argv,"Aad:flnprtu:vVwym:T:")) != EOF) ++ while ((c = getopt(argc,argv,"Aad:flnprtu:vVwyIm:T:")) != EOF) + switch (c) { + case 'A': /* toggle Atari format */ + atari_format = !atari_format; +@@ -177,6 +179,9 @@ + return 2; + } + break; ++ case 'I': ++ skip_trivial_errors = 1; ++ break; + default: + usage(argv[0]); + } +@@ -200,8 +205,8 @@ + while (read_fat(&fs), scan_root(&fs)) qfree(&mem_queue); + if (test) fix_bad(&fs); + if (salvage_files) reclaim_file(&fs); +- else reclaim_free(&fs); +- free_clusters = update_free(&fs); ++ else reclaim_free(&fs, skip_trivial_errors); ++ free_clusters = update_free(&fs, skip_trivial_errors); + file_unused(); + qfree(&mem_queue); + n_files_check = n_files; +@@ -210,7 +215,7 @@ + printf("Starting verification pass.\n"); + read_fat(&fs); + scan_root(&fs); +- reclaim_free(&fs); ++ reclaim_free(&fs, skip_trivial_errors); + qfree(&mem_queue); + n_files_verify = n_files; + } +Index: dosfstools-3.0.1/src/fat.c +=================================================================== +--- dosfstools-3.0.1/src/fat.c 2009-04-01 10:59:54.000000000 +0300 ++++ dosfstools-3.0.1/src/fat.c 2009-04-01 15:41:00.000000000 +0300 +@@ -240,7 +240,7 @@ + } + + +-void reclaim_free(DOS_FS *fs) ++void reclaim_free(DOS_FS *fs, int skip_trivial_errors) + { + int reclaimed; + unsigned long i; +@@ -251,7 +251,9 @@ + for (i = 2; i < fs->clusters+2; i++) + if (!get_owner(fs,i) && fs->fat[i].value && + !FAT_IS_BAD(fs,fs->fat[i].value)) { +- set_fat(fs,i,0); ++ if ( !skip_trivial_errors ) { ++ set_fat(fs,i,0); ++ } + reclaimed++; + } + if (reclaimed) +@@ -341,7 +343,7 @@ + } + + +-unsigned long update_free(DOS_FS *fs) ++unsigned long update_free(DOS_FS *fs, int skip_trivial_errors) + { + unsigned long i; + unsigned long free = 0; +@@ -379,8 +381,10 @@ + if (do_set) { + fs->free_clusters = free; + free = CT_LE_L(free); +- fs_write(fs->fsinfo_start+offsetof(struct info_sector,free_clusters), +- sizeof(free),&free); ++ if ( !skip_trivial_errors ) { ++ fs_write(fs->fsinfo_start+offsetof(struct info_sector,free_clusters), ++ sizeof(free),&free); ++ } + } + + return free; +Index: dosfstools-3.0.1/src/fat.h +=================================================================== +--- dosfstools-3.0.1/src/fat.h 2009-04-01 11:03:59.000000000 +0300 ++++ dosfstools-3.0.1/src/fat.h 2009-04-01 15:40:27.000000000 +0300 +@@ -64,7 +64,7 @@ + + /* Scans the disk for currently unused bad clusters and marks them as bad. */ + +-void reclaim_free(DOS_FS *fs); ++void reclaim_free(DOS_FS *fs, int skip_trivial_errors); + + /* Marks all allocated, but unused clusters as free. */ + +@@ -74,7 +74,7 @@ + for them in the root directory. Also tries to fix all inconsistencies (e.g. + loops, shared clusters, etc.) in the process. */ + +-unsigned long update_free(DOS_FS *fs); ++unsigned long update_free(DOS_FS *fs, int skip_trivial_errors); + + /* Updates free cluster count in FSINFO sector. */ + Modified: projects/haf/trunk/dosfstools/debian/patches/series =================================================================== --- projects/haf/trunk/dosfstools/debian/patches/series 2009-04-01 15:44:14 UTC (rev 17962) +++ projects/haf/trunk/dosfstools/debian/patches/series 2009-04-01 15:45:18 UTC (rev 17963) @@ -12,3 +12,4 @@ 14-error_code.patch 15-osso-memory.patch 16-time_limit.patch +17-ignore-free-clusters.patch
- Previous message: [maemo-commits] r17962 - projects/haf/tags/ke-recv
- Next message: [maemo-commits] r17964 - projects/haf/tags/dosfstools
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]