projects
/
yaffs2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
yaffs: more clean up
[yaffs2.git]
/
yaffs_verify.c
diff --git
a/yaffs_verify.c
b/yaffs_verify.c
index 5bdddc0c5923fa273c51780527b6c5f1bc638f04..e15bb321fc6d7cb762c8fdf00e5cbb86e14ee6ae 100644
(file)
--- a/
yaffs_verify.c
+++ b/
yaffs_verify.c
@@
-18,19
+18,19
@@
#include "yaffs_getblockinfo.h"
#include "yaffs_nand.h"
#include "yaffs_getblockinfo.h"
#include "yaffs_nand.h"
-int yaffs_skip_verification(
yaffs_dev_t
*dev)
+int yaffs_skip_verification(
struct yaffs_dev
*dev)
{
dev=dev;
return !(yaffs_trace_mask & (YAFFS_TRACE_VERIFY | YAFFS_TRACE_VERIFY_FULL));
}
{
dev=dev;
return !(yaffs_trace_mask & (YAFFS_TRACE_VERIFY | YAFFS_TRACE_VERIFY_FULL));
}
-static int yaffs_skip_full_verification(
yaffs_dev_t
*dev)
+static int yaffs_skip_full_verification(
struct yaffs_dev
*dev)
{
dev=dev;
return !(yaffs_trace_mask & (YAFFS_TRACE_VERIFY_FULL));
}
{
dev=dev;
return !(yaffs_trace_mask & (YAFFS_TRACE_VERIFY_FULL));
}
-static int yaffs_skip_nand_verification(
yaffs_dev_t
*dev)
+static int yaffs_skip_nand_verification(
struct yaffs_dev
*dev)
{
dev=dev;
return !(yaffs_trace_mask & (YAFFS_TRACE_VERIFY_NAND));
{
dev=dev;
return !(yaffs_trace_mask & (YAFFS_TRACE_VERIFY_NAND));
@@
-51,7
+51,7
@@
static const char *block_state_name[] = {
};
};
-void yaffs_verify_blk(
yaffs_dev_t *dev, yaffs_block_info_t
*bi, int n)
+void yaffs_verify_blk(
struct yaffs_dev *dev, struct yaffs_block_info
*bi, int n)
{
int actually_used;
int in_use;
{
int actually_used;
int in_use;
@@
-92,7
+92,7
@@
void yaffs_verify_blk(yaffs_dev_t *dev, yaffs_block_info_t *bi, int n)
-void yaffs_verify_collected_blk(
yaffs_dev_t *dev, yaffs_block_info_t
*bi, int n)
+void yaffs_verify_collected_blk(
struct yaffs_dev *dev, struct yaffs_block_info
*bi, int n)
{
yaffs_verify_blk(dev, bi, n);
{
yaffs_verify_blk(dev, bi, n);
@@
-105,7
+105,7
@@
void yaffs_verify_collected_blk(yaffs_dev_t *dev, yaffs_block_info_t *bi, int n)
}
}
}
}
-void yaffs_verify_blocks(
yaffs_dev_t
*dev)
+void yaffs_verify_blocks(
struct yaffs_dev
*dev)
{
int i;
int state_count[YAFFS_NUMBER_OF_BLOCK_STATES];
{
int i;
int state_count[YAFFS_NUMBER_OF_BLOCK_STATES];
@@
-117,7
+117,7
@@
void yaffs_verify_blocks(yaffs_dev_t *dev)
memset(state_count, 0, sizeof(state_count));
for (i = dev->internal_start_block; i <= dev->internal_end_block; i++) {
memset(state_count, 0, sizeof(state_count));
for (i = dev->internal_start_block; i <= dev->internal_end_block; i++) {
-
yaffs_block_info_t
*bi = yaffs_get_block_info(dev, i);
+
struct yaffs_block_info
*bi = yaffs_get_block_info(dev, i);
yaffs_verify_blk(dev, bi, i);
if (bi->block_state < YAFFS_NUMBER_OF_BLOCK_STATES)
yaffs_verify_blk(dev, bi, i);
if (bi->block_state < YAFFS_NUMBER_OF_BLOCK_STATES)
@@
-161,7
+161,7
@@
void yaffs_verify_blocks(yaffs_dev_t *dev)
* Verify the object header. oh must be valid, but obj and tags may be NULL in which
* case those tests will not be performed.
*/
* Verify the object header. oh must be valid, but obj and tags may be NULL in which
* case those tests will not be performed.
*/
-void yaffs_verify_oh(
yaffs_obj_t *obj, yaffs_obj_header *oh,
yaffs_ext_tags *tags, int parent_check)
+void yaffs_verify_oh(
struct yaffs_obj *obj, struct yaffs_obj_hdr *oh, struct
yaffs_ext_tags *tags, int parent_check)
{
if (obj && yaffs_skip_verification(obj->my_dev))
return;
{
if (obj && yaffs_skip_verification(obj->my_dev))
return;
@@
-217,16
+217,16
@@
void yaffs_verify_oh(yaffs_obj_t *obj, yaffs_obj_header *oh, yaffs_ext_tags *tag
-void yaffs_verify_file(
yaffs_obj_t
*obj)
+void yaffs_verify_file(
struct yaffs_obj
*obj)
{
int required_depth;
int actual_depth;
u32 last_chunk;
u32 x;
u32 i;
{
int required_depth;
int actual_depth;
u32 last_chunk;
u32 x;
u32 i;
-
yaffs_dev_t
*dev;
- yaffs_ext_tags tags;
-
yaffs_tnode_t
*tn;
+
struct yaffs_dev
*dev;
+
struct
yaffs_ext_tags tags;
+
struct yaffs_tnode
*tn;
u32 obj_id;
if (!obj)
u32 obj_id;
if (!obj)
@@
-276,7
+276,7
@@
void yaffs_verify_file(yaffs_obj_t *obj)
}
}
-void yaffs_verify_link(
yaffs_obj_t
*obj)
+void yaffs_verify_link(
struct yaffs_obj
*obj)
{
if (obj && yaffs_skip_verification(obj->my_dev))
return;
{
if (obj && yaffs_skip_verification(obj->my_dev))
return;
@@
-284,7
+284,7
@@
void yaffs_verify_link(yaffs_obj_t *obj)
/* Verify sane equivalent object */
}
/* Verify sane equivalent object */
}
-void yaffs_verify_symlink(
yaffs_obj_t
*obj)
+void yaffs_verify_symlink(
struct yaffs_obj
*obj)
{
if (obj && yaffs_skip_verification(obj->my_dev))
return;
{
if (obj && yaffs_skip_verification(obj->my_dev))
return;
@@
-292,15
+292,15
@@
void yaffs_verify_symlink(yaffs_obj_t *obj)
/* Verify symlink string */
}
/* Verify symlink string */
}
-void yaffs_verify_special(
yaffs_obj_t
*obj)
+void yaffs_verify_special(
struct yaffs_obj
*obj)
{
if (obj && yaffs_skip_verification(obj->my_dev))
return;
}
{
if (obj && yaffs_skip_verification(obj->my_dev))
return;
}
-void yaffs_verify_obj(
yaffs_obj_t
*obj)
+void yaffs_verify_obj(
struct yaffs_obj
*obj)
{
{
-
yaffs_dev_t
*dev;
+
struct yaffs_dev
*dev;
u32 chunk_min;
u32 chunk_max;
u32 chunk_min;
u32 chunk_max;
@@
-345,11
+345,11
@@
void yaffs_verify_obj(yaffs_obj_t *obj)
}
if (chunk_valid && !yaffs_skip_nand_verification(dev)) {
}
if (chunk_valid && !yaffs_skip_nand_verification(dev)) {
- yaffs_ext_tags tags;
-
yaffs_obj_heade
r *oh;
+
struct
yaffs_ext_tags tags;
+
struct yaffs_obj_hd
r *oh;
u8 *buffer = yaffs_get_temp_buffer(dev, __LINE__);
u8 *buffer = yaffs_get_temp_buffer(dev, __LINE__);
- oh = (
yaffs_obj_heade
r *)buffer;
+ oh = (
struct yaffs_obj_hd
r *)buffer;
yaffs_rd_chunk_tags_nand(dev, obj->hdr_chunk, buffer,
&tags);
yaffs_rd_chunk_tags_nand(dev, obj->hdr_chunk, buffer,
&tags);
@@
-399,11
+399,11
@@
void yaffs_verify_obj(yaffs_obj_t *obj)
}
}
}
}
-void yaffs_verify_objects(
yaffs_dev_t
*dev)
+void yaffs_verify_objects(
struct yaffs_dev
*dev)
{
{
-
yaffs_obj_t
*obj;
+
struct yaffs_obj
*obj;
int i;
int i;
- struct
y
list_head *lh;
+ struct list_head *lh;
if (yaffs_skip_verification(dev))
return;
if (yaffs_skip_verification(dev))
return;
@@
-411,9
+411,9
@@
void yaffs_verify_objects(yaffs_dev_t *dev)
/* Iterate through the objects in each hash entry */
for (i = 0; i < YAFFS_NOBJECT_BUCKETS; i++) {
/* Iterate through the objects in each hash entry */
for (i = 0; i < YAFFS_NOBJECT_BUCKETS; i++) {
-
y
list_for_each(lh, &dev->obj_bucket[i].list) {
+ list_for_each(lh, &dev->obj_bucket[i].list) {
if (lh) {
if (lh) {
- obj =
ylist_entry(lh, yaffs_obj_t
, hash_link);
+ obj =
list_entry(lh, struct yaffs_obj
, hash_link);
yaffs_verify_obj(obj);
}
}
yaffs_verify_obj(obj);
}
}
@@
-421,10
+421,10
@@
void yaffs_verify_objects(yaffs_dev_t *dev)
}
}
-void yaffs_verify_obj_in_dir(
yaffs_obj_t
*obj)
+void yaffs_verify_obj_in_dir(
struct yaffs_obj
*obj)
{
{
- struct
y
list_head *lh;
-
yaffs_obj_t
*list_obj;
+ struct list_head *lh;
+
struct yaffs_obj
*list_obj;
int count = 0;
int count = 0;
@@
-450,9
+450,9
@@
void yaffs_verify_obj_in_dir(yaffs_obj_t *obj)
/* Iterate through the objects in each hash entry */
/* Iterate through the objects in each hash entry */
-
y
list_for_each(lh, &obj->parent->variant.dir_variant.children) {
+ list_for_each(lh, &obj->parent->variant.dir_variant.children) {
if (lh) {
if (lh) {
- list_obj =
ylist_entry(lh, yaffs_obj_t
, siblings);
+ list_obj =
list_entry(lh, struct yaffs_obj
, siblings);
yaffs_verify_obj(list_obj);
if (obj == list_obj)
count++;
yaffs_verify_obj(list_obj);
if (obj == list_obj)
count++;
@@
-465,10
+465,10
@@
void yaffs_verify_obj_in_dir(yaffs_obj_t *obj)
}
}
}
}
-void yaffs_verify_dir(
yaffs_obj_t
*directory)
+void yaffs_verify_dir(
struct yaffs_obj
*directory)
{
{
- struct
y
list_head *lh;
-
yaffs_obj_t
*list_obj;
+ struct list_head *lh;
+
struct yaffs_obj
*list_obj;
if (!directory) {
YBUG();
if (!directory) {
YBUG();
@@
-487,9
+487,9
@@
void yaffs_verify_dir(yaffs_obj_t *directory)
/* Iterate through the objects in each hash entry */
/* Iterate through the objects in each hash entry */
-
y
list_for_each(lh, &directory->variant.dir_variant.children) {
+ list_for_each(lh, &directory->variant.dir_variant.children) {
if (lh) {
if (lh) {
- list_obj =
ylist_entry(lh, yaffs_obj_t
, siblings);
+ list_obj =
list_entry(lh, struct yaffs_obj
, siblings);
if (list_obj->parent != directory) {
T(YAFFS_TRACE_ALWAYS, (
TSTR("Object in directory list has wrong parent %p" TENDSTR),
if (list_obj->parent != directory) {
T(YAFFS_TRACE_ALWAYS, (
TSTR("Object in directory list has wrong parent %p" TENDSTR),
@@
-503,7
+503,7
@@
void yaffs_verify_dir(yaffs_obj_t *directory)
static int yaffs_free_verification_failures;
static int yaffs_free_verification_failures;
-void yaffs_verify_free_chunks(
yaffs_dev_t
*dev)
+void yaffs_verify_free_chunks(
struct yaffs_dev
*dev)
{
int counted;
int difference;
{
int counted;
int difference;
@@
-523,7
+523,7
@@
void yaffs_verify_free_chunks(yaffs_dev_t *dev)
}
}
}
}
-int yaffs_verify_file_sane(
yaffs_obj_t
*in)
+int yaffs_verify_file_sane(
struct yaffs_obj
*in)
{
in=in;
return YAFFS_OK;
{
in=in;
return YAFFS_OK;