u8 *chunk_data;
- T(YAFFS_TRACE_SCAN,
- (TSTR("yaffs1_scan starts intstartblk %d intendblk %d..." TENDSTR),
- dev->internal_start_block, dev->internal_end_block));
+ yaffs_trace(YAFFS_TRACE_SCAN,
+ "yaffs1_scan starts intstartblk %d intendblk %d...",
+ dev->internal_start_block, dev->internal_end_block);
chunk_data = yaffs_get_temp_buffer(dev, __LINE__);
if (bi->seq_number == YAFFS_SEQUENCE_BAD_BLOCK)
bi->block_state = state = YAFFS_BLOCK_STATE_DEAD;
- T(YAFFS_TRACE_SCAN_DEBUG,
- (TSTR("Block scanning block %d state %d seq %d" TENDSTR), blk,
- state, seq_number));
+ yaffs_trace(YAFFS_TRACE_SCAN_DEBUG,
+ "Block scanning block %d state %d seq %d",
+ blk, state, seq_number);
if (state == YAFFS_BLOCK_STATE_DEAD) {
- T(YAFFS_TRACE_BAD_BLOCKS,
- (TSTR("block %d is bad" TENDSTR), blk));
+ yaffs_trace(YAFFS_TRACE_BAD_BLOCKS,
+ "block %d is bad", blk);
} else if (state == YAFFS_BLOCK_STATE_EMPTY) {
- T(YAFFS_TRACE_SCAN_DEBUG,
- (TSTR("Block empty " TENDSTR)));
+ yaffs_trace(YAFFS_TRACE_SCAN_DEBUG, "Block empty ");
dev->n_erased_blocks++;
dev->n_free_chunks += dev->param.chunks_per_block;
}
for (blk = dev->internal_start_block;
!alloc_failed && blk <= dev->internal_end_block; blk++) {
- YYIELD();
+ cond_resched();
bi = yaffs_get_block_info(dev, blk);
state = bi->block_state;
dev->n_erased_blocks++;
} else {
/* this is the block being allocated from */
- T(YAFFS_TRACE_SCAN,
- (TSTR
- (" Allocating from %d %d" TENDSTR),
- blk, c));
+ yaffs_trace(YAFFS_TRACE_SCAN,
+ " Allocating from %d %d",
+ blk, c);
state = YAFFS_BLOCK_STATE_ALLOCATING;
dev->alloc_block = blk;
dev->alloc_page = c;
struct yaffs_shadow_fixer *fixer;
fixer =
- YMALLOC(sizeof
- (struct
- yaffs_shadow_fixer));
+ kmalloc(sizeof
+ (struct yaffs_shadow_fixer),
+ GFP_NOFS);
if (fixer) {
fixer->next = shadow_fixers;
shadow_fixers = fixer;
fixer->obj_id = tags.obj_id;
fixer->shadowed_id =
oh->shadows_obj;
- T(YAFFS_TRACE_SCAN,
- (TSTR
- (" Shadow fixer: %d shadows %d"
- TENDSTR), fixer->obj_id,
- fixer->shadowed_id));
+ yaffs_trace(YAFFS_TRACE_SCAN,
+ " Shadow fixer: %d shadows %d",
+ fixer->obj_id,
+ fixer->shadowed_id);
}
variant.dir_variant.children);
} else if (!parent
|| parent->variant_type !=
- YAFFS_OBJECT_TYPE_DIRECTORY)
- {
+ YAFFS_OBJECT_TYPE_DIRECTORY) {
/* Hoosterman, another problem....
* We're trying to use a non-directory as a directory
*/
- T(YAFFS_TRACE_ERROR,
- (TSTR
- ("yaffs tragedy: attempting to use non-directory as a directory in scan. Put in lost+found."
- TENDSTR)));
+ yaffs_trace(YAFFS_TRACE_ERROR,
+ "yaffs tragedy: attempting to use non-directory as a directory in scan. Put in lost+found."
+ );
parent = dev->lost_n_found;
}
if (obj)
yaffs_update_oh(obj, NULL, 1, 0, 0, NULL);
- YFREE(fixer);
+ kfree(fixer);
}
}
if (alloc_failed)
return YAFFS_FAIL;
- T(YAFFS_TRACE_SCAN, (TSTR("yaffs1_scan ends" TENDSTR)));
+ yaffs_trace(YAFFS_TRACE_SCAN, "yaffs1_scan ends");
return YAFFS_OK;
}