*/
const char *yaffs_fs_c_version =
- "$Id: yaffs_fs.c,v 1.90 2009-12-23 03:14:17 charles Exp $";
+ "$Id: yaffs_fs.c,v 1.93 2010-02-10 03:54:08 charles Exp $";
extern const char *yaffs_guts_c_version;
#include <linux/version.h>
#include <linux/uaccess.h>
#include "yportenv.h"
+#include "yaffs_trace.h"
#include "yaffs_guts.h"
#include <linux/mtd/mtd.h>
};
#endif
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,25))
+static void zero_user_segment(struct page *page, unsigned start, unsigned end)
+{
+ void * kaddr = kmap_atomic(page, KM_USER0);
+ memset(kaddr + start, 0, end - start);
+ kunmap_atomic(kaddr, KM_USER0);
+ flush_dcache_page(page);
+}
+#endif
+
+
static const struct inode_operations yaffs_file_inode_operations = {
.setattr = yaffs_setattr,
};
dev = obj->myDev;
- T(YAFFS_TRACE_OS, ("yaffs_sync_object\n"));
+ T(YAFFS_TRACE_OS | YAFFS_TRACE_SYNC, ("yaffs_sync_object\n"));
yaffs_GrossLock(dev);
yaffs_FlushFile(obj, 1, datasync);
yaffs_GrossUnlock(dev);
static int yaffs_setattr(struct dentry *dentry, struct iattr *attr)
{
struct inode *inode = dentry->d_inode;
- int error;
+ int error = 0;
yaffs_Device *dev;
T(YAFFS_TRACE_OS,
("yaffs_setattr of object %d\n",
yaffs_InodeToObject(inode)->objectId));
- error = inode_change_ok(inode, attr);
+ /* Fail if a requested resize >= 2GB */
+ if (attr->ia_valid & ATTR_SIZE &&
+ (attr->ia_size >> 31))
+ error = -EINVAL;
+
+ if (error == 0)
+ error = inode_change_ok(inode, attr);
if (error == 0) {
int result;
if (!error){
yaffs_GrossUnlock(dev);
}
+
T(YAFFS_TRACE_OS,
- ("yaffs_setattr done\n"));
+ ("yaffs_setattr done returning %d\n",error));
return error;
}
{
yaffs_Device *dev = yaffs_SuperToDevice(sb);
- T(YAFFS_TRACE_OS, ("yaffs_do_sync_fs\n"));
+ T(YAFFS_TRACE_OS | YAFFS_TRACE_SYNC, ("yaffs_do_sync_fs\n"));
if (sb->s_dirt) {
yaffs_GrossLock(dev);
#endif
{
- T(YAFFS_TRACE_OS, ("yaffs_write_super\n"));
+ T(YAFFS_TRACE_OS | YAFFS_TRACE_SYNC, ("yaffs_write_super\n"));
if (yaffs_auto_checkpoint >= 2)
yaffs_do_sync_fs(sb);
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 18))
static int yaffs_sync_fs(struct super_block *sb)
#endif
{
- T(YAFFS_TRACE_OS, ("yaffs_sync_fs\n"));
+ T(YAFFS_TRACE_OS | YAFFS_TRACE_SYNC, ("yaffs_sync_fs\n"));
if (yaffs_auto_checkpoint >= 1)
yaffs_do_sync_fs(sb);
{"scan_debug", YAFFS_TRACE_SCAN_DEBUG},
{"scan", YAFFS_TRACE_SCAN},
{"tracing", YAFFS_TRACE_TRACING},
+ {"sync", YAFFS_TRACE_SYNC},
{"verify", YAFFS_TRACE_VERIFY},
{"verify_nand", YAFFS_TRACE_VERIFY_NAND},