if (tn) {
ok = (yaffs2_checkpt_rd(dev, tn, dev->tnode_size) ==
dev->tnode_size);
- } else
+ } else {
ok = 0;
+ }
if (tn && ok)
ok = yaffs_add_find_tnode_0(dev,
TENDSTR), cp.obj_id, cp.parent_id, cp.variant_type,
cp.hdr_chunk));
- if (ok && cp.obj_id == ~0)
+ if (ok && cp.obj_id == ~0) {
done = 1;
- else if (ok) {
+ } else if (ok) {
obj =
yaffs_find_or_create_by_number(dev, cp.obj_id,
cp.variant_type);
(struct list_head *)hard_list;
hard_list = obj;
}
- } else
+ } else {
ok = 0;
+ }
}
}
yaffs2_wr_checkpt_data(dev);
}
- T(YAFFS_TRACE_ALWAYS,
+ T(YAFFS_TRACE_CHECKPOINT | YAFFS_TRACE_MOUNT,
(TSTR("save exit: is_checkpointed %d" TENDSTR),
dev->is_checkpointed));
if (written == this_write) {
pos += this_write;
increase -= this_write;
- } else
+ } else {
small_increase_ok = 0;
+ }
}
yaffs_release_temp_buffer(dev, local_buffer, __LINE__);
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;
}
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)));
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;
in->yst_mode = oh->yst_mode;
yaffs_load_attribs(in, oh);
in->lazy_loaded = 0;
- } else
+ } else {
in->lazy_loaded = 1;
-
+ }
in->hdr_chunk = chunk;
} else if (!in->valid) {
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
*/
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.