修改后的代码:

yaffs_vfs.c中



------------------------------------------------------------------------

#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 17))

static int yaffs_file_flush(struct file *file, fl_owner_t id)

#else

static int yaffs_file_flush(struct file *file)

#endif

{

struct yaffs_obj *obj = yaffs_dentry_to_obj(file->f_dentry);


struct yaffs_dev *dev = obj->my_dev;


yaffs_trace(YAFFS_TRACE_OS,

"yaffs_file_flush object %d (%s)",

obj->obj_id,

obj->dirty ? "dirty" : "clean");


yaffs_gross_lock(dev);


yaffs_flush_file(obj, 1, 0, 0);    //error


yaffs_gross_unlock(dev);


return 0;

}

----------------------------------------------------------------------

#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 39))

static int yaffs_sync_object(struct file *file, loff_t start, loff_t end, int datasync)

#elif (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 34))

static int yaffs_sync_object(struct file *file, int datasync)

#else

static int yaffs_sync_object(struct file *file, struct dentry *dentry,

    int datasync)

#endif

{

struct yaffs_obj *obj;

struct yaffs_dev *dev;

#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 34))

struct dentry *dentry = file->f_path.dentry;

#endif


obj = yaffs_dentry_to_obj(dentry);


dev = obj->my_dev;


yaffs_trace(YAFFS_TRACE_OS | YAFFS_TRACE_SYNC,

"yaffs_sync_object");

yaffs_gross_lock(dev);

yaffs_flush_file(obj, 1, datasync, 0);     //error

yaffs_gross_unlock(dev);

return 0;

}

------------------------------------------------------------------------------

static void yaffs_flush_inodes(struct super_block *sb)

{

struct inode *iptr;

struct yaffs_obj *obj;


list_for_each_entry(iptr, &sb->s_inodes, i_sb_list) {

obj = yaffs_inode_to_obj(iptr);

if (obj) {

yaffs_trace(YAFFS_TRACE_OS,

"flushing obj %d",

obj->obj_id);

yaffs_flush_file(obj, 1, 0, 0); //error

}

}

}


static void yaffs_flush_super(struct super_block *sb, int do_checkpoint)

{

struct yaffs_dev *dev = yaffs_super_to_dev(sb);

if (!dev)

return;


yaffs_flush_inodes(sb);

yaffs_update_dirty_dirs(dev);

yaffs_flush_whole_cache(dev, 0);    //error

if (do_checkpoint)

yaffs_checkpoint_save(dev);

}

-----------------------------------------------------------------------------