projects
/
yaffs2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
yaffs got the make files to work for timothy_tests/quick_tests
[yaffs2.git]
/
yaffs_yaffs1.c
diff --git
a/yaffs_yaffs1.c
b/yaffs_yaffs1.c
index 6ee91a139e1ae508acec7fc26a091d740fdeefb0..d277e20e2a554cee97d28e91430ea24e839d4775 100644
(file)
--- a/
yaffs_yaffs1.c
+++ b/
yaffs_yaffs1.c
@@
-1,7
+1,7
@@
/*
* YAFFS: Yet Another Flash File System. A NAND-flash specific file system.
*
/*
* YAFFS: Yet Another Flash File System. A NAND-flash specific file system.
*
- * Copyright (C) 2002-201
0
Aleph One Ltd.
+ * Copyright (C) 2002-201
1
Aleph One Ltd.
* for Toby Churchill Ltd and Brightstar Engineering
*
* Created by Charles Manning <charles@aleph1.co.uk>
* for Toby Churchill Ltd and Brightstar Engineering
*
* Created by Charles Manning <charles@aleph1.co.uk>
@@
-28,7
+28,7
@@
int yaffs1_scan(struct yaffs_dev *dev)
int c;
int deleted;
enum yaffs_block_state state;
int c;
int deleted;
enum yaffs_block_state state;
-
struct yaffs_obj *hard_list = NULL
;
+
LIST_HEAD(hard_list)
;
struct yaffs_block_info *bi;
u32 seq_number;
struct yaffs_obj_hdr *oh;
struct yaffs_block_info *bi;
u32 seq_number;
struct yaffs_obj_hdr *oh;
@@
-42,7
+42,7
@@
int yaffs1_scan(struct yaffs_dev *dev)
"yaffs1_scan starts intstartblk %d intendblk %d...",
dev->internal_start_block, dev->internal_end_block);
"yaffs1_scan starts intstartblk %d intendblk %d...",
dev->internal_start_block, dev->internal_end_block);
- chunk_data = yaffs_get_temp_buffer(dev
, __LINE__
);
+ chunk_data = yaffs_get_temp_buffer(dev);
dev->seq_number = YAFFS_LOWEST_SEQUENCE_NUMBER;
dev->seq_number = YAFFS_LOWEST_SEQUENCE_NUMBER;
@@
-89,8
+89,9
@@
int yaffs1_scan(struct yaffs_dev *dev)
deleted = 0;
/* For each chunk in each block that needs scanning.... */
deleted = 0;
/* For each chunk in each block that needs scanning.... */
- for (c = 0; !alloc_failed && c < dev->param.chunks_per_block &&
- state == YAFFS_BLOCK_STATE_NEEDS_SCANNING; c++) {
+ for (c = 0;
+ !alloc_failed && c < dev->param.chunks_per_block &&
+ state == YAFFS_BLOCK_STATE_NEEDS_SCAN; c++) {
/* Read the tags and decide what to do */
chunk = blk * dev->param.chunks_per_block + c;
/* Read the tags and decide what to do */
chunk = blk * dev->param.chunks_per_block + c;
@@
-99,8
+100,8
@@
int yaffs1_scan(struct yaffs_dev *dev)
/* Let's have a good look at this chunk... */
/* Let's have a good look at this chunk... */
- if (tags.ecc_result == YAFFS_ECC_RESULT_UNFIXED
-
||
tags.is_deleted) {
+ if (tags.ecc_result == YAFFS_ECC_RESULT_UNFIXED
||
+ tags.is_deleted) {
/* YAFFS1 only...
* A deleted chunk
*/
/* YAFFS1 only...
* A deleted chunk
*/
@@
-160,9
+161,9
@@
int yaffs1_scan(struct yaffs_dev *dev)
tags.n_bytes;
if (in &&
in->variant_type ==
tags.n_bytes;
if (in &&
in->variant_type ==
- YAFFS_OBJECT_TYPE_FILE &&
+
YAFFS_OBJECT_TYPE_FILE &&
in->variant.file_variant.scanned_size <
in->variant.file_variant.scanned_size <
- endpos) {
+
endpos) {
in->variant.file_variant.scanned_size =
endpos;
if (!dev->param.use_header_file_size) {
in->variant.file_variant.scanned_size =
endpos;
if (!dev->param.use_header_file_size) {
@@
-322,20
+323,16
@@
int yaffs1_scan(struct yaffs_dev *dev)
case YAFFS_OBJECT_TYPE_FILE:
if (dev->param.
use_header_file_size)
case YAFFS_OBJECT_TYPE_FILE:
if (dev->param.
use_header_file_size)
-
in->variant.
in->variant.
- file_variant.file_size
- = oh->file_size;
-
+ file_variant.file_size
+ = yaffs_oh_to_size(oh);
break;
case YAFFS_OBJECT_TYPE_HARDLINK:
in->variant.
hardlink_variant.equiv_id =
oh->equiv_id;
break;
case YAFFS_OBJECT_TYPE_HARDLINK:
in->variant.
hardlink_variant.equiv_id =
oh->equiv_id;
- in->hard_links.next =
- (struct list_head *)
- hard_list;
- hard_list = in;
+ list_add(&in->hard_links,
+ &hard_list);
break;
case YAFFS_OBJECT_TYPE_DIRECTORY:
/* Do nothing */
break;
case YAFFS_OBJECT_TYPE_DIRECTORY:
/* Do nothing */
@@
-356,7
+353,7
@@
int yaffs1_scan(struct yaffs_dev *dev)
}
}
}
}
- if (state == YAFFS_BLOCK_STATE_NEEDS_SCAN
NING
) {
+ if (state == YAFFS_BLOCK_STATE_NEEDS_SCAN) {
/* If we got this far while scanning,
* then the block is fully allocated. */
state = YAFFS_BLOCK_STATE_FULL;
/* If we got this far while scanning,
* then the block is fully allocated. */
state = YAFFS_BLOCK_STATE_FULL;
@@
-374,9
+371,8
@@
int yaffs1_scan(struct yaffs_dev *dev)
/* Now let's see if it was dirty */
if (bi->pages_in_use == 0 &&
!bi->has_shrink_hdr &&
/* Now let's see if it was dirty */
if (bi->pages_in_use == 0 &&
!bi->has_shrink_hdr &&
- bi->block_state == YAFFS_BLOCK_STATE_FULL)
{
+ bi->block_state == YAFFS_BLOCK_STATE_FULL)
yaffs_block_became_dirty(dev, blk);
yaffs_block_became_dirty(dev, blk);
- }
}
/* Ok, we've done all the scanning.
}
/* Ok, we've done all the scanning.
@@
-385,9
+381,12
@@
int yaffs1_scan(struct yaffs_dev *dev)
* these hardlinks.
*/
* these hardlinks.
*/
- yaffs_link_fixup(dev, hard_list);
+ yaffs_link_fixup(dev,
&
hard_list);
- /* Fix up any shadowed objects */
+ /*
+ * Fix up any shadowed objects.
+ * There should not be more than one of these.
+ */
{
struct yaffs_shadow_fixer *fixer;
struct yaffs_obj *obj;
{
struct yaffs_shadow_fixer *fixer;
struct yaffs_obj *obj;
@@
-412,7
+411,7
@@
int yaffs1_scan(struct yaffs_dev *dev)
}
}
}
}
- yaffs_release_temp_buffer(dev, chunk_data
, __LINE__
);
+ yaffs_release_temp_buffer(dev, chunk_data);
if (alloc_failed)
return YAFFS_FAIL;
if (alloc_failed)
return YAFFS_FAIL;