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);
sc = yaffs_NewSearch(obj);
if(!sc){
retVal = -ENOMEM;
- goto unlock_out;
+ goto out;
}
T(YAFFS_TRACE_OS, (TSTR("yaffs_readdir: starting at %d\n"), (int)offset));
(TSTR("yaffs_readdir: entry . ino %d \n"),
(int)inode->i_ino));
yaffs_GrossUnlock(dev);
- if (filldir(dirent, ".", 1, offset, inode->i_ino, DT_DIR) < 0)
+ if (filldir(dirent, ".", 1, offset, inode->i_ino, DT_DIR) < 0){
+ yaffs_GrossLock(dev);
goto out;
+ }
yaffs_GrossLock(dev);
offset++;
f->f_pos++;
(int)f->f_dentry->d_parent->d_inode->i_ino));
yaffs_GrossUnlock(dev);
if (filldir(dirent, "..", 2, offset,
- f->f_dentry->d_parent->d_inode->i_ino, DT_DIR) < 0)
+ f->f_dentry->d_parent->d_inode->i_ino, DT_DIR) < 0){
+ yaffs_GrossLock(dev);
goto out;
+ }
yaffs_GrossLock(dev);
offset++;
f->f_pos++;
strlen(name),
offset,
this_inode,
- this_type) < 0)
+ this_type) < 0){
+ yaffs_GrossLock(dev);
goto out;
+ }
yaffs_GrossLock(dev);
yaffs_SearchAdvance(sc);
}
-unlock_out:
+out:
+ yaffs_EndSearch(sc);
yaffs_DeviceToContext(dev)->readdirProcess = NULL;
-
yaffs_GrossUnlock(dev);
-out:
- yaffs_EndSearch(sc);
return retVal;
}
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);
if (error == 0) {
- int result;
dev = obj->myDev;
yaffs_GrossLock(dev);
error = yaffs_ListXAttributes(obj, buff, size);
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;