From: Charles Manning Date: Wed, 30 Jun 2010 00:07:01 +0000 (+1200) Subject: Merge branch 'master' of ssh://www.aleph1.co.uk/home/aleph1/git/yaffs2 X-Git-Tag: pre-name-change~50 X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs2.git;a=commitdiff_plain;h=299791ad6d378fae30d50560097a7633cde3aab2;hp=f7d2b7170fc175d00a2ba529e1a74af76967130d Merge branch 'master' of ssh://aleph1.co.uk/home/aleph1/git/yaffs2 --- diff --git a/direct/yaffsfs.c b/direct/yaffsfs.c index c095132..041287c 100644 --- a/direct/yaffsfs.c +++ b/direct/yaffsfs.c @@ -826,10 +826,10 @@ int yaffsfs_do_write(int fd, const void *vbuf, unsigned int nbyte, int isPwrite, yaffsfs_SetError(-EINVAL); totalWritten=-1; } else if( h && obj){ - if(isPwrite) - startPos = offset; if(h->append) startPos = yaffs_GetObjectFileLength(obj); + else if(isPwrite) + startPos = offset; else startPos = h->position; diff --git a/yaffs_fs.c b/yaffs_fs.c index 91d3a81..9469e1b 100644 --- a/yaffs_fs.c +++ b/yaffs_fs.c @@ -202,8 +202,12 @@ static int yaffs_file_flush(struct file *file, fl_owner_t id); static int yaffs_file_flush(struct file *file); #endif +#if (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 static int yaffs_readdir(struct file *f, void *dirent, filldir_t filldir); @@ -1742,12 +1746,19 @@ static int yaffs_symlink(struct inode *dir, struct dentry *dentry, return -ENOMEM; } +#if (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 { yaffs_Object *obj; yaffs_Device *dev; +#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 34)) + struct dentry *dentry = file->f_path.dentry; +#endif obj = yaffs_DentryToObject(dentry); @@ -1965,7 +1976,6 @@ ssize_t yaffs_listxattr(struct dentry *dentry, char *buff, size_t size) if (error == 0) { - int result; dev = obj->myDev; yaffs_GrossLock(dev); error = yaffs_ListXAttributes(obj, buff, size); @@ -2217,7 +2227,7 @@ static int yaffs_BackgroundThread(void *data) if(time_before(expires,now)) expires = now + HZ; - init_timer(&timer); + init_timer_on_stack(&timer); timer.expires = expires+1; timer.data = (unsigned long) current; timer.function = yaffs_background_waker;