obj->serial = cp->serial;
obj->n_data_chunks = cp->n_data_chunks;
- if (obj->variant_type == YAFFS_OBJECT_TYPE_FILE)
+ if (obj->variant_type == YAFFS_OBJECT_TYPE_FILE) {
obj->variant.file_variant.file_size = cp->size_or_equiv_obj;
- else if (obj->variant_type == YAFFS_OBJECT_TYPE_HARDLINK)
+ obj->variant.file_variant.stored_size = cp->size_or_equiv_obj;
+ } else if (obj->variant_type == YAFFS_OBJECT_TYPE_HARDLINK) {
obj->variant.hardlink_variant.equiv_id = cp->size_or_equiv_obj;
-
+ }
if (obj->hdr_chunk > 0)
obj->lazy_loaded = 1;
return 1;
endpos = chunk_base + tags.n_bytes;
if (!in->valid &&
- in->variant.file_variant.scanned_size < endpos) {
+ in->variant.file_variant.stored_size < endpos) {
in->variant.file_variant.
- scanned_size = endpos;
+ stored_size = endpos;
in->variant.file_variant.
file_size = endpos;
}
}
if (!in->valid && in->variant_type !=
- (oh ? oh->type : tags.extra_obj_type))
+ (oh ? oh->type : tags.extra_obj_type)) {
yaffs_trace(YAFFS_TRACE_ERROR,
- "yaffs tragedy: Bad object type, %d != %d, for object %d at chunk %d during scan",
+ "yaffs tragedy: Bad type, %d != %d, for object %d at chunk %d during scan",
oh ? oh->type : tags.extra_obj_type,
in->variant_type, tags.obj_id,
chunk);
+ in = yaffs_retype_obj(in, oh ? oh->type : tags.extra_obj_type);
+ }
if (!in->valid &&
(tags.obj_id == YAFFS_OBJECTID_ROOT ||
break;
case YAFFS_OBJECT_TYPE_FILE:
file_var = &in->variant.file_variant;
- if (file_var->scanned_size < file_size) {
+ if (file_var->stored_size < file_size) {
/* This covers the case where the file
* size is greater than the data held.
* This will happen if the file is
* current data extents.
*/
file_var->file_size = file_size;
- file_var->scanned_size = file_size;
+ file_var->stored_size = file_size;
}
if (file_var->shrink_size > file_size)
int n_to_scan = 0;
enum yaffs_block_state state;
int c;
- int deleted;
LIST_HEAD(hard_list);
struct yaffs_block_info *bi;
u32 seq_number;
bi++;
}
- yaffs_trace(YAFFS_TRACE_SCAN, "%d blocks to be sorted...", n_to_scan);
+ yaffs_trace(YAFFS_TRACE_ALWAYS, "%d blocks to be sorted...", n_to_scan);
cond_resched();
/* get the block to scan in the correct order */
blk = block_index[block_iter].block;
bi = yaffs_get_block_info(dev, blk);
- deleted = 0;
summary_available = yaffs_summary_read(dev, dev->sum_tags, blk);
/* For each chunk in each block that needs scanning.... */
found_chunks = 0;
- if(summary_available)
+ if (summary_available)
c = dev->chunks_per_summary - 1;
else
c = dev->param.chunks_per_block - 1;