mtd/util flash_eraseall.c,1.18,1.19
lavinen at infradead.org
lavinen at infradead.org
Thu Dec 9 06:06:10 EST 2004
- Previous message: mtd/fs/jffs2 nodelist.c,1.89,1.90
- Next message: mtd/fs/jffs3 .cvsignore, NONE, 3.1 GNUmakefile, NONE, 3.1 LICENCE,
NONE, 3.1 Makefile, NONE, 3.1 Makefile.24, NONE,
3.1 Makefile.common, NONE, 3.1 README.Locking, NONE, 3.1 TODO,
NONE, 3.1 background.c, NONE, 3.1 build.c, NONE, 3.1 compr.c,
NONE, 3.1 compr.h, NONE, 3.1 compr_lzari.c, NONE,
3.1 compr_lzo.c, NONE, 3.1 compr_rtime.c, NONE,
3.1 compr_rubin.c, NONE, 3.1 compr_rubin.h, NONE,
3.1 compr_zlib.c, NONE, 3.1 comprtest.c, NONE, 3.1 crc32.c,
NONE, 3.1 crc32.h, NONE, 3.1 defconfig, NONE, 3.1 dir.c, NONE,
3.1 erase.c, NONE, 3.1 file.c, NONE, 3.1 fs.c, NONE, 3.1 gc.c,
NONE, 3.1 histo.h, NONE, 3.1 histo_mips.h, NONE, 3.1 ioctl.c,
NONE, 3.1 jffs3.h, NONE, 3.1 jffs3_fs_i.h, NONE,
3.1 jffs3_fs_sb.h, NONE, 3.1 malloc.c, NONE, 3.1 nodelist.c,
NONE, 3.1 nodelist.h, NONE, 3.1 nodemgmt.c, NONE,
3.1 os-linux.h, NONE, 3.1 pushpull.h, NONE, 3.1 rbtree.c, NONE,
3.1 read.c, NONE, 3.1 readinode.c, NONE, 3.1 scan.c, NONE,
3.1 super-v24.c, NONE, 3.1 super.c, NONE, 3.1 symlink-v24.c,
NONE, 3.1 symlink.c, NONE, 3.1 wbuf.c, NONE, 3.1 write.c, NONE,
3.1 writev.c, NONE, 3.1
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /home/cvs/mtd/util
In directory phoenix.infradead.org:/tmp/cvs-serv16056
Modified Files:
flash_eraseall.c
Log Message:
Fixed overflow in progress percent. Added check for bad blocks.
Index: flash_eraseall.c
===================================================================
RCS file: /home/cvs/mtd/util/flash_eraseall.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- flash_eraseall.c 2 Dec 2004 19:27:54 -0000 1.18
+++ flash_eraseall.c 9 Dec 2004 11:06:07 -0000 1.19
@@ -61,7 +61,7 @@
mtd_info_t meminfo;
int fd, clmpos = 0, clmlen = 8;
erase_info_t erase;
- int isNAND;
+ int isNAND, bbtest = 1;
process_options(argc, argv);
@@ -127,11 +127,27 @@
}
for (erase.start = 0; erase.start < meminfo.size; erase.start += meminfo.erasesize) {
+ if (bbtest) {
+ loff_t offset = erase.start;
+ int ret = ioctl(fd, MEMGETBADBLOCK, &offset);
+ if (ret > 0) {
+ if (!quiet)
+ printf ("\nSkipping bad block at 0x%08x\n", erase.start);
+ continue;
+ } else if (ret == -EOPNOTSUPP) {
+ fprintf(stderr, "%s: %s: Bad block check not available\n", exe_name, mtd_device);
+ bbtest = 0;
+ } else if (ret < 0) {
+ fprintf(stderr, "\n%s: %s: MTD get bad block failed: %s\n", exe_name, mtd_device, strerror(errno));
+ exit(1);
+ }
+ }
if (!quiet) {
printf
- ("\rErasing %d Kibyte @ %x -- %2d %% complete.",
+ ("\rErasing %d Kibyte @ %x -- %2llu %% complete.",
meminfo.erasesize / 1024, erase.start,
+ (unsigned long long)
erase.start * 100 / meminfo.size);
}
fflush(stdout);
- Previous message: mtd/fs/jffs2 nodelist.c,1.89,1.90
- Next message: mtd/fs/jffs3 .cvsignore, NONE, 3.1 GNUmakefile, NONE, 3.1 LICENCE,
NONE, 3.1 Makefile, NONE, 3.1 Makefile.24, NONE,
3.1 Makefile.common, NONE, 3.1 README.Locking, NONE, 3.1 TODO,
NONE, 3.1 background.c, NONE, 3.1 build.c, NONE, 3.1 compr.c,
NONE, 3.1 compr.h, NONE, 3.1 compr_lzari.c, NONE,
3.1 compr_lzo.c, NONE, 3.1 compr_rtime.c, NONE,
3.1 compr_rubin.c, NONE, 3.1 compr_rubin.h, NONE,
3.1 compr_zlib.c, NONE, 3.1 comprtest.c, NONE, 3.1 crc32.c,
NONE, 3.1 crc32.h, NONE, 3.1 defconfig, NONE, 3.1 dir.c, NONE,
3.1 erase.c, NONE, 3.1 file.c, NONE, 3.1 fs.c, NONE, 3.1 gc.c,
NONE, 3.1 histo.h, NONE, 3.1 histo_mips.h, NONE, 3.1 ioctl.c,
NONE, 3.1 jffs3.h, NONE, 3.1 jffs3_fs_i.h, NONE,
3.1 jffs3_fs_sb.h, NONE, 3.1 malloc.c, NONE, 3.1 nodelist.c,
NONE, 3.1 nodelist.h, NONE, 3.1 nodemgmt.c, NONE,
3.1 os-linux.h, NONE, 3.1 pushpull.h, NONE, 3.1 rbtree.c, NONE,
3.1 read.c, NONE, 3.1 readinode.c, NONE, 3.1 scan.c, NONE,
3.1 super-v24.c, NONE, 3.1 super.c, NONE, 3.1 symlink-v24.c,
NONE, 3.1 symlink.c, NONE, 3.1 wbuf.c, NONE, 3.1 write.c, NONE,
3.1 writev.c, NONE, 3.1
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the linux-mtd-cvs
mailing list