X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs2.git;a=blobdiff_plain;f=yaffs_fs.c;h=e4ea466b54365b4512502743c4437d36d2c098b5;hp=bfa7d6a923f654e16a6d1a4c8c0b05326450411d;hb=9625e7b16224f286bb177324f2c1283b9db08286;hpb=9fbb3cb4918cf53826d95905132c1a80a48f0d05 diff --git a/yaffs_fs.c b/yaffs_fs.c index bfa7d6a..e4ea466 100644 --- a/yaffs_fs.c +++ b/yaffs_fs.c @@ -30,7 +30,7 @@ */ -const char *yaffs_fs_c_version = "$Id: yaffs_fs.c,v 1.25 2005-08-01 20:55:24 luc Exp $"; +const char *yaffs_fs_c_version = "$Id: yaffs_fs.c,v 1.28 2005-08-09 03:52:23 charles Exp $"; extern const char *yaffs_guts_c_version; @@ -488,6 +488,7 @@ static int yaffs_writepage(struct page *page) #endif { struct address_space *mapping = page->mapping; + loff_t offset = (loff_t)page->index << PAGE_CACHE_SHIFT; struct inode *inode; unsigned long end_index; char *buffer; @@ -501,6 +502,14 @@ static int yaffs_writepage(struct page *page) if (!inode) BUG(); + if (offset > inode->i_size) + { + T(YAFFS_TRACE_OS,(KERN_DEBUG"yaffs_writepage at %08x, inode size = %08x!!!\n", (unsigned)(page->index << PAGE_CACHE_SHIFT), (unsigned) inode->i_size)); + T(YAFFS_TRACE_OS,(KERN_DEBUG" -> don't care!!\n")); + unlock_page(page); + return 0; + } + end_index = inode->i_size >> PAGE_CACHE_SHIFT; /* easy case */ @@ -525,9 +534,13 @@ static int yaffs_writepage(struct page *page) obj = yaffs_InodeToObject(inode); yaffs_GrossLock(obj->myDev); + T(YAFFS_TRACE_OS,(KERN_DEBUG"yaffs_writepage at %08x, size %08x\n", (unsigned)(page->index << PAGE_CACHE_SHIFT), nBytes)); + T(YAFFS_TRACE_OS,(KERN_DEBUG"writepag0: obj = %05x, ino = %05x\n", (int) obj->variant.fileVariant.fileSize, (int) inode->i_size)); nWritten = yaffs_WriteDataToFile(obj,buffer,page->index << PAGE_CACHE_SHIFT,nBytes,0); + T(YAFFS_TRACE_OS,(KERN_DEBUG"writepag1: obj = %05x, ino = %05x\n", (int) obj->variant.fileVariant.fileSize, (int) inode->i_size)); + yaffs_GrossUnlock(obj->myDev); kunmap(page); @@ -1082,10 +1095,8 @@ static int yaffs_rename(struct inode * old_dir, struct dentry *old_dentry, struc else { - // Unlink the target if it exists - removed = yaffs_Unlink(yaffs_InodeToObject(new_dir),new_dentry->d_name.name); - - + // Now does unlinking internally using shadowing mechanism + retVal = yaffs_RenameObject(yaffs_InodeToObject(old_dir),old_dentry->d_name.name, yaffs_InodeToObject(new_dir),new_dentry->d_name.name); @@ -1409,7 +1420,7 @@ static struct super_block *yaffs_internal_read_super(int yaffsVersion, struct su dev->putSuperFunc = yaffs_MTDPutSuper; -#ifdef CONFIG_YAFFS_USE_NANDECC +#ifndef CONFIG_YAFFS_DOES_ECC dev->useNANDECC = 1; #endif