#include "yaffs_yaffs2.h"
#include "yaffs_checkptrw.h"
#include "yaffs_bitmap.h"
-#include "yaffs_qsort.h"
#include "yaffs_nand.h"
#include "yaffs_getblockinfo.h"
#include "yaffs_verify.h"
+#include "yaffs_attribs.h"
/*
* Checkpoints are really no benefit on very small partitions.
struct yaffs_checkpt_obj cp;
int i;
int ok = 1;
- struct ylist_head *lh;
+ struct list_head *lh;
/* Iterate through the objects in each hash entry,
*/
for (i = 0; ok && i < YAFFS_NOBJECT_BUCKETS; i++) {
- ylist_for_each(lh, &dev->obj_bucket[i].list) {
+ list_for_each(lh, &dev->obj_bucket[i].list) {
if (lh) {
- obj = ylist_entry(lh, struct yaffs_obj, hash_link);
+ obj = list_entry(lh, struct yaffs_obj, hash_link);
if (!obj->defered_free) {
yaffs2_obj_checkpt_obj(&cp, obj);
cp.struct_type = sizeof(cp);
ok = yaffs2_rd_checkpt_tnodes(obj);
} else if (obj->variant_type == YAFFS_OBJECT_TYPE_HARDLINK) {
obj->hard_links.next =
- (struct ylist_head *) hard_list;
+ (struct list_head *) hard_list;
hard_list = obj;
}
} else
}
-typedef struct {
+struct yaffs_block_index{
int seq;
int block;
-} yaffs_block_index;
+};
static int yaffs2_ybicmp(const void *a, const void *b)
{
- register int aseq = ((yaffs_block_index *)a)->seq;
- register int bseq = ((yaffs_block_index *)b)->seq;
- register int ablock = ((yaffs_block_index *)a)->block;
- register int bblock = ((yaffs_block_index *)b)->block;
+ int aseq = ((struct yaffs_block_index *)a)->seq;
+ int bseq = ((struct yaffs_block_index *)b)->seq;
+ int ablock = ((struct yaffs_block_index *)a)->block;
+ int bblock = ((struct yaffs_block_index *)b)->block;
if (aseq == bseq)
return ablock - bblock;
else
int alloc_failed = 0;
- yaffs_block_index *block_index = NULL;
+ struct yaffs_block_index *block_index = NULL;
int alt_block_index = 0;
T(YAFFS_TRACE_SCAN,
dev->seq_number = YAFFS_LOWEST_SEQUENCE_NUMBER;
- block_index = YMALLOC(n_blocks * sizeof(yaffs_block_index));
+ block_index = YMALLOC(n_blocks * sizeof(struct yaffs_block_index));
if (!block_index) {
- block_index = YMALLOC_ALT(n_blocks * sizeof(yaffs_block_index));
+ block_index = YMALLOC_ALT(n_blocks * sizeof(struct yaffs_block_index));
alt_block_index = 1;
}
YYIELD();
/* Sort the blocks by sequence number*/
- yaffs_qsort(block_index, n_to_scan, sizeof(yaffs_block_index), yaffs2_ybicmp);
+ yaffs_sort(block_index, n_to_scan, sizeof(struct yaffs_block_index), yaffs2_ybicmp);
YYIELD();
if (oh) {
in->yst_mode = oh->yst_mode;
-#ifdef CONFIG_YAFFS_WINCE
- in->win_atime[0] = oh->win_atime[0];
- in->win_ctime[0] = oh->win_ctime[0];
- in->win_mtime[0] = oh->win_mtime[0];
- in->win_atime[1] = oh->win_atime[1];
- in->win_ctime[1] = oh->win_ctime[1];
- in->win_mtime[1] = oh->win_mtime[1];
-#else
- in->yst_uid = oh->yst_uid;
- in->yst_gid = oh->yst_gid;
- in->yst_atime = oh->yst_atime;
- in->yst_mtime = oh->yst_mtime;
- in->yst_ctime = oh->yst_ctime;
- in->yst_rdev = oh->yst_rdev;
-
+ yaffs_load_attribs(in, oh);
in->lazy_loaded = 0;
-
-#endif
} else
in->lazy_loaded = 1;
in->variant_type = oh->type;
in->yst_mode = oh->yst_mode;
-#ifdef CONFIG_YAFFS_WINCE
- in->win_atime[0] = oh->win_atime[0];
- in->win_ctime[0] = oh->win_ctime[0];
- in->win_mtime[0] = oh->win_mtime[0];
- in->win_atime[1] = oh->win_atime[1];
- in->win_ctime[1] = oh->win_ctime[1];
- in->win_mtime[1] = oh->win_mtime[1];
-#else
- in->yst_uid = oh->yst_uid;
- in->yst_gid = oh->yst_gid;
- in->yst_atime = oh->yst_atime;
- in->yst_mtime = oh->yst_mtime;
- in->yst_ctime = oh->yst_ctime;
- in->yst_rdev = oh->yst_rdev;
-#endif
+ yaffs_load_attribs(in, oh);
if (oh->shadows_obj > 0)
yaffs_handle_shadowed_obj(dev,
/* Set up as a directory */
parent->variant_type =
YAFFS_OBJECT_TYPE_DIRECTORY;
- YINIT_LIST_HEAD(&parent->variant.
+ INIT_LIST_HEAD(&parent->variant.
dir_variant.
children);
} else if (!parent || parent->variant_type !=
in->variant.hardlink_variant.equiv_id =
equiv_id;
in->hard_links.next =
- (struct ylist_head *) hard_list;
+ (struct list_head *) hard_list;
hard_list = in;
}
break;