* of hole marker.
*/
loff_t old_file_size;
- int increase;
+ loff_t increase;
int small_hole;
int result = YAFFS_OK;
struct yaffs_dev *dev = NULL;
if (local_buffer) {
/* fill hole with zero bytes */
- int pos = old_file_size;
+ loff_t pos = old_file_size;
int this_write;
int written;
memset(local_buffer, 0, dev->data_bytes_per_chunk);
struct yaffs_obj *in;
struct yaffs_obj *parent;
int equiv_id;
- int file_size;
+ loff_t file_size;
int is_shrink;
int is_unlinked;
struct yaffs_ext_tags tags;
result = yaffs_summary_fetch(dev, &tags, chunk_in_block);
tags.seq_number = bi->seq_number;
}
-
- if (!summary_available || tags.obj_id == 0)
+
+ if (!summary_available || tags.obj_id == 0) {
result = yaffs_rd_chunk_tags_nand(dev, chunk, NULL, &tags);
+ dev->tags_used++;
+ } else {
+ dev->summary_used++;
+ }
/* Let's have a good look at this chunk... */
dev->n_free_chunks++;
} else if (tags.obj_id > YAFFS_MAX_OBJECT_ID ||
tags.chunk_id > YAFFS_MAX_CHUNK_ID ||
+ tags.obj_id == YAFFS_OBJECTID_SUMMARY ||
(tags.chunk_id > 0 &&
tags.n_bytes > dev->data_bytes_per_chunk) ||
tags.seq_number != bi->seq_number) {
dev->n_free_chunks++;
} else if (tags.chunk_id > 0) {
/* chunk_id > 0 so it is a data chunk... */
- unsigned int endpos;
- u32 chunk_base = (tags.chunk_id - 1) *
+ loff_t endpos;
+ loff_t chunk_base = (tags.chunk_id - 1) *
dev->data_bytes_per_chunk;
*found_chunks = 1;
(tags.extra_available &&
tags.extra_obj_type == YAFFS_OBJECT_TYPE_FILE)
)) {
- u32 this_size = (oh) ?
- oh->file_size :
- tags.extra_length;
+ loff_t this_size = (oh) ?
+ yaffs_oh_to_size(oh) :
+ tags.extra_file_size;
u32 parent_obj_id = (oh) ?
oh->parent_obj_id :
tags.extra_parent_id;
parent = yaffs_find_or_create_by_number(dev,
oh->parent_obj_id,
YAFFS_OBJECT_TYPE_DIRECTORY);
- file_size = oh->file_size;
+ file_size = yaffs_oh_to_size(oh);
is_shrink = oh->is_shrink;
equiv_id = oh->equiv_id;
} else {
parent = yaffs_find_or_create_by_number(dev,
tags.extra_parent_id,
YAFFS_OBJECT_TYPE_DIRECTORY);
- file_size = tags.extra_length;
+ file_size = tags.extra_file_size;
is_shrink = tags.extra_is_shrink;
equiv_id = tags.extra_equiv_id;
in->lazy_loaded = 1;
bi = yaffs_get_block_info(dev, blk);
deleted = 0;
- summary_available = yaffs_summary_read(dev, blk);
+ 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;