aboutsummaryrefslogtreecommitdiffstats
path: root/fs/jffs2/scan.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/jffs2/scan.c')
-rw-r--r--fs/jffs2/scan.c48
1 files changed, 3 insertions, 45 deletions
diff --git a/fs/jffs2/scan.c b/fs/jffs2/scan.c
index 4e60ba8da197..8df7456472b8 100644
--- a/fs/jffs2/scan.c
+++ b/fs/jffs2/scan.c
@@ -7,7 +7,7 @@
7 * 7 *
8 * For licensing information, see the file 'LICENCE' in this directory. 8 * For licensing information, see the file 'LICENCE' in this directory.
9 * 9 *
10 * $Id: scan.c,v 1.122 2005/09/07 08:34:54 havasi Exp $ 10 * $Id: scan.c,v 1.124 2005/09/21 13:05:22 dedekind Exp $
11 * 11 *
12 */ 12 */
13#include <linux/kernel.h> 13#include <linux/kernel.h>
@@ -429,7 +429,7 @@ static int jffs2_scan_eraseblock (struct jffs2_sb_info *c, struct jffs2_eraseblo
429 429
430 noise = 10; 430 noise = 10;
431 431
432 JFFS2_DBG_SUMMARY("no summary found in jeb 0x%08x. Apply original scan.\n",jeb->offset); 432 dbg_summary("no summary found in jeb 0x%08x. Apply original scan.\n",jeb->offset);
433 433
434scan_more: 434scan_more:
435 while(ofs < jeb->offset + c->sector_size) { 435 while(ofs < jeb->offset + c->sector_size) {
@@ -684,7 +684,7 @@ scan_more:
684 684
685 if (jffs2_sum_active()) { 685 if (jffs2_sum_active()) {
686 if (PAD(s->sum_size + JFFS2_SUMMARY_FRAME_SIZE) > jeb->free_size) { 686 if (PAD(s->sum_size + JFFS2_SUMMARY_FRAME_SIZE) > jeb->free_size) {
687 JFFS2_DBG_SUMMARY("There is not enough space for " 687 dbg_summary("There is not enough space for "
688 "summary information, disabling for this jeb!\n"); 688 "summary information, disabling for this jeb!\n");
689 jffs2_sum_disable_collecting(s); 689 jffs2_sum_disable_collecting(s);
690 } 690 }
@@ -920,76 +920,34 @@ void jffs2_rotate_lists(struct jffs2_sb_info *c)
920 x = count_list(&c->clean_list); 920 x = count_list(&c->clean_list);
921 if (x) { 921 if (x) {
922 rotateby = pseudo_random % x; 922 rotateby = pseudo_random % x;
923 D1(printk(KERN_DEBUG "Rotating clean_list by %d\n", rotateby));
924
925 rotate_list((&c->clean_list), rotateby); 923 rotate_list((&c->clean_list), rotateby);
926
927 D1(printk(KERN_DEBUG "Erase block at front of clean_list is at %08x\n",
928 list_entry(c->clean_list.next, struct jffs2_eraseblock, list)->offset));
929 } else {
930 D1(printk(KERN_DEBUG "Not rotating empty clean_list\n"));
931 } 924 }
932 925
933 x = count_list(&c->very_dirty_list); 926 x = count_list(&c->very_dirty_list);
934 if (x) { 927 if (x) {
935 rotateby = pseudo_random % x; 928 rotateby = pseudo_random % x;
936 D1(printk(KERN_DEBUG "Rotating very_dirty_list by %d\n", rotateby));
937
938 rotate_list((&c->very_dirty_list), rotateby); 929 rotate_list((&c->very_dirty_list), rotateby);
939
940 D1(printk(KERN_DEBUG "Erase block at front of very_dirty_list is at %08x\n",
941 list_entry(c->very_dirty_list.next, struct jffs2_eraseblock, list)->offset));
942 } else {
943 D1(printk(KERN_DEBUG "Not rotating empty very_dirty_list\n"));
944 } 930 }
945 931
946 x = count_list(&c->dirty_list); 932 x = count_list(&c->dirty_list);
947 if (x) { 933 if (x) {
948 rotateby = pseudo_random % x; 934 rotateby = pseudo_random % x;
949 D1(printk(KERN_DEBUG "Rotating dirty_list by %d\n", rotateby));
950
951 rotate_list((&c->dirty_list), rotateby); 935 rotate_list((&c->dirty_list), rotateby);
952
953 D1(printk(KERN_DEBUG "Erase block at front of dirty_list is at %08x\n",
954 list_entry(c->dirty_list.next, struct jffs2_eraseblock, list)->offset));
955 } else {
956 D1(printk(KERN_DEBUG "Not rotating empty dirty_list\n"));
957 } 936 }
958 937
959 x = count_list(&c->erasable_list); 938 x = count_list(&c->erasable_list);
960 if (x) { 939 if (x) {
961 rotateby = pseudo_random % x; 940 rotateby = pseudo_random % x;
962 D1(printk(KERN_DEBUG "Rotating erasable_list by %d\n", rotateby));
963
964 rotate_list((&c->erasable_list), rotateby); 941 rotate_list((&c->erasable_list), rotateby);
965
966 D1(printk(KERN_DEBUG "Erase block at front of erasable_list is at %08x\n",
967 list_entry(c->erasable_list.next, struct jffs2_eraseblock, list)->offset));
968 } else {
969 D1(printk(KERN_DEBUG "Not rotating empty erasable_list\n"));
970 } 942 }
971 943
972 if (c->nr_erasing_blocks) { 944 if (c->nr_erasing_blocks) {
973 rotateby = pseudo_random % c->nr_erasing_blocks; 945 rotateby = pseudo_random % c->nr_erasing_blocks;
974 D1(printk(KERN_DEBUG "Rotating erase_pending_list by %d\n", rotateby));
975
976 rotate_list((&c->erase_pending_list), rotateby); 946 rotate_list((&c->erase_pending_list), rotateby);
977
978 D1(printk(KERN_DEBUG "Erase block at front of erase_pending_list is at %08x\n",
979 list_entry(c->erase_pending_list.next, struct jffs2_eraseblock, list)->offset));
980 } else {
981 D1(printk(KERN_DEBUG "Not rotating empty erase_pending_list\n"));
982 } 947 }
983 948
984 if (c->nr_free_blocks) { 949 if (c->nr_free_blocks) {
985 rotateby = pseudo_random % c->nr_free_blocks; 950 rotateby = pseudo_random % c->nr_free_blocks;
986 D1(printk(KERN_DEBUG "Rotating free_list by %d\n", rotateby));
987
988 rotate_list((&c->free_list), rotateby); 951 rotate_list((&c->free_list), rotateby);
989
990 D1(printk(KERN_DEBUG "Erase block at front of free_list is at %08x\n",
991 list_entry(c->free_list.next, struct jffs2_eraseblock, list)->offset));
992 } else {
993 D1(printk(KERN_DEBUG "Not rotating empty free_list\n"));
994 } 952 }
995} 953}