X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs2.git;a=blobdiff_plain;f=yaffs_yaffs2.c;h=87733fd49efd1d027222a879a73f8ead0afe8f75;hp=4f11765be346c6b13fcc6c694140151dc414788a;hb=fb1a7ee223619260cfd9b6366fd78747cc572cd5;hpb=84f122f301b6a27295641fcbde3a6fbcfea78a99 diff --git a/yaffs_yaffs2.c b/yaffs_yaffs2.c index 4f11765..87733fd 100644 --- a/yaffs_yaffs2.c +++ b/yaffs_yaffs2.c @@ -1001,11 +1001,12 @@ int yaffs2_scan_backwards(struct yaffs_dev *dev) dev->seq_number = YAFFS_LOWEST_SEQUENCE_NUMBER; - block_index = YMALLOC(n_blocks * sizeof(struct yaffs_block_index)); + block_index = kmalloc(n_blocks * sizeof(struct yaffs_block_index), + GFP_NOFS); if (!block_index) { block_index = - YMALLOC_ALT(n_blocks * sizeof(struct yaffs_block_index)); + vmalloc(n_blocks * sizeof(struct yaffs_block_index)); alt_block_index = 1; } @@ -1082,13 +1083,13 @@ int yaffs2_scan_backwards(struct yaffs_dev *dev) T(YAFFS_TRACE_SCAN, (TSTR("%d blocks to be sorted..." TENDSTR), n_to_scan)); - YYIELD(); + cond_resched(); /* Sort the blocks by sequence number */ - yaffs_sort(block_index, n_to_scan, sizeof(struct yaffs_block_index), - yaffs2_ybicmp); + sort(block_index, n_to_scan, sizeof(struct yaffs_block_index), + yaffs2_ybicmp, NULL); - YYIELD(); + cond_resched(); T(YAFFS_TRACE_SCAN, (TSTR("...done" TENDSTR))); @@ -1103,7 +1104,7 @@ int yaffs2_scan_backwards(struct yaffs_dev *dev) block_iter--) { /* Cooperative multitasking! This loop can run for so long that watchdog timers expire. */ - YYIELD(); + cond_resched(); /* get the block to scan in the correct order */ blk = block_index[block_iter].block; @@ -1598,9 +1599,9 @@ int yaffs2_scan_backwards(struct yaffs_dev *dev) yaffs_skip_rest_of_block(dev); if (alt_block_index) - YFREE_ALT(block_index); + vfree(block_index); else - YFREE(block_index); + kfree(block_index); /* Ok, we've done all the scanning. * Fix up the hard link chains.