Mercurial > yaffs-ecoscentric-gpl
view yaffs_mtdif.c @ 404:792f3d959342
yaffs: More background gc tweaks.
Slight changes to urgency thresholds
Fix problem where background gc was interfering with sync resulting in
checkpoints being lost.
Add more tracing for background gc.
Signed-off-by: Charles Manning <cdhmanning@gmail.com>
| author | Charles Manning <cdhmanning@gmail.com> |
|---|---|
| date | Tue, 20 Apr 2010 14:36:01 +1200 |
| parents | 05cd3ca9ab0a |
| children | b5309c9b6d7f |
line wrap: on
line source
/* * YAFFS: Yet Another Flash File System. A NAND-flash specific file system. * * Copyright (C) 2002-2007 Aleph One Ltd. * for Toby Churchill Ltd and Brightstar Engineering * * Created by Charles Manning <charles@aleph1.co.uk> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ const char *yaffs_mtdif_c_version = "$Id: yaffs_mtdif.c,v 1.25 2010-02-19 01:06:31 charles Exp $"; #include "yportenv.h" #include "yaffs_mtdif.h" #include "linux/mtd/mtd.h" #include "linux/types.h" #include "linux/time.h" #include "linux/mtd/nand.h" #include "yaffs_linux.h" int nandmtd_EraseBlockInNAND(yaffs_Device *dev, int blockNumber) { struct mtd_info *mtd = yaffs_DeviceToContext(dev)->mtd; __u32 addr = ((loff_t) blockNumber) * dev->param.totalBytesPerChunk * dev->param.nChunksPerBlock; struct erase_info ei; int retval = 0; ei.mtd = mtd; ei.addr = addr; ei.len = dev->param.totalBytesPerChunk * dev->param.nChunksPerBlock; ei.time = 1000; ei.retries = 2; ei.callback = NULL; ei.priv = (u_long) dev; retval = mtd->erase(mtd, &ei); if (retval == 0) return YAFFS_OK; else return YAFFS_FAIL; } int nandmtd_InitialiseNAND(yaffs_Device *dev) { return YAFFS_OK; }
