#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.
}
-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,