projects
/
yaffs2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
yaffs: Change disable-summary option to be consistent with others
[yaffs2.git]
/
direct
/
basic-test
/
yaffs_fileem2k.c
diff --git
a/direct/basic-test/yaffs_fileem2k.c
b/direct/basic-test/yaffs_fileem2k.c
index d8fde7382730e713e5496c5821e43e4ebf86e33c..836d1f7b97b263a6fcb561045371fb051d45d775 100644
(file)
--- a/
direct/basic-test/yaffs_fileem2k.c
+++ b/
direct/basic-test/yaffs_fileem2k.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>
@@
-24,15
+24,15
@@
const char *yaffs_flashif2_c_version = "$Id: yaffs_fileem2k.c,v 1.24 2010-02-18
#include "yaffs_flashif2.h"
#include "yaffs_guts.h"
#include "yaffs_flashif2.h"
#include "yaffs_guts.h"
+#include "yaffs_fileem2k.h"
+#include "yaffs_packedtags2.h"
+
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
-#include "yaffs_fileem2k.h"
-#include "yaffs_packedtags2.h"
-
#define REPORT_ERROR 0
#define REPORT_ERROR 0
@@
-65,7
+65,6
@@
int yaffs_test_partial_write = 0;
extern int random_seed;
extern int simulate_power_failure;
extern int random_seed;
extern int simulate_power_failure;
-static int initialised = 0;
static int remaining_ops;
static int nops_so_far;
static int remaining_ops;
static int nops_so_far;
@@
-179,7
+178,7
@@
int yflash2_WriteChunkWithTagsToNAND(struct yaffs_dev *dev,int nand_chunk,const
int nRead;
int error;
int nRead;
int error;
-
T(YAFFS_TRACE_MTD,(TSTR("write chunk %d data %x tags %x" TENDSTR),nand_chunk,(unsigned)data, (unsigned)tags)
);
+
yaffs_trace(YAFFS_TRACE_MTD, "write chunk %d data %p tags %p",nand_chunk, data, tags
);
CheckInit();
CheckInit();
@@
-396,7
+395,7
@@
int yflash2_ReadChunkWithTagsFromNAND(struct yaffs_dev *dev,int nand_chunk, u8 *
int retval = YAFFS_OK;
int nRead;
int retval = YAFFS_OK;
int nRead;
-
T(YAFFS_TRACE_MTD,(TSTR("read chunk %d data %x tags %x" TENDSTR),nand_chunk,(unsigned)data, (unsigned)tags)
);
+
yaffs_trace(YAFFS_TRACE_MTD,"read chunk %d data %p tags %p",nand_chunk, data, tags
);
CheckInit();
CheckInit();
@@
-407,7
+406,7
@@
int yflash2_ReadChunkWithTagsFromNAND(struct yaffs_dev *dev,int nand_chunk, u8 *
/* Got to suck the tags out of the data area */
if(!data) {
localData=1;
/* Got to suck the tags out of the data area */
if(!data) {
localData=1;
- data = yaffs_get_temp_buffer(dev
,__LINE__
);
+ data = yaffs_get_temp_buffer(dev);
}
}
@@
-428,7
+427,7
@@
int yflash2_ReadChunkWithTagsFromNAND(struct yaffs_dev *dev,int nand_chunk, u8 *
retval = YAFFS_FAIL;
if(localData)
retval = YAFFS_FAIL;
if(localData)
- yaffs_release_temp_buffer(dev,
data,__LINE__
);
+ yaffs_release_temp_buffer(dev,
data
);
@@
-460,14
+459,10
@@
int yflash2_ReadChunkWithTagsFromNAND(struct yaffs_dev *dev,int nand_chunk, u8 *
nread= read(h,tags,sizeof(struct yaffs_ext_tags));
if(nread != sizeof(struct yaffs_ext_tags))
retval = YAFFS_FAIL;
nread= read(h,tags,sizeof(struct yaffs_ext_tags));
if(nread != sizeof(struct yaffs_ext_tags))
retval = YAFFS_FAIL;
- if(yaffs_check_all_ff((u8 *)tags,sizeof(struct yaffs_ext_tags)))
- {
- yaffs_init_tags(tags);
- }
+ if(yaffs_check_all_ff((u8 *)tags, sizeof(struct yaffs_ext_tags)))
+ memset(tags, 0, sizeof(struct yaffs_ext_tags));
else
else
- {
tags->chunk_used = 1;
tags->chunk_used = 1;
- }
}
else
{
}
else
{
@@
-536,14
+531,14
@@
int yflash2_EraseBlockInNAND(struct yaffs_dev *dev, int blockNumber)
CheckInit();
CheckInit();
- printf("erase block %d\n",blockNumber);
+
//
printf("erase block %d\n",blockNumber);
if(blockNumber == 320)
fail320 = 1;
if(blockNumber < 0 || blockNumber >= filedisk.nBlocks)
{
if(blockNumber == 320)
fail320 = 1;
if(blockNumber < 0 || blockNumber >= filedisk.nBlocks)
{
-
T(YAFFS_TRACE_ALWAYS,("Attempt to erase non-existant block %d\n",blockNumber)
);
+
yaffs_trace(YAFFS_TRACE_ALWAYS,"Attempt to erase non-existant block %d",blockNumber
);
return YAFFS_FAIL;
}
else
return YAFFS_FAIL;
}
else
@@
-599,7
+594,7
@@
int yflash2_QueryNANDBlock(struct yaffs_dev *dev, int block_no, enum yaffs_block
}
else if(tags.chunk_used)
{
}
else if(tags.chunk_used)
{
- *state = YAFFS_BLOCK_STATE_NEEDS_SCAN
NING
;
+ *state = YAFFS_BLOCK_STATE_NEEDS_SCAN;
*seq_number = tags.seq_number;
}
return YAFFS_OK;
*seq_number = tags.seq_number;
}
return YAFFS_OK;