return err;
}
-int unionfs_fsync(struct file *file, int datasync)
+int unionfs_fsync(struct file *file, loff_t start, loff_t end, int datasync)
{
int bindex, bstart, bend;
struct file *lower_file;
struct inode *lower_inode, *inode;
int err = -EINVAL;
+ lockdep_off();
unionfs_read_lock(dentry->d_sb, UNIONFS_SMUTEX_PARENT);
parent = unionfs_lock_parent(dentry, UNIONFS_DMUTEX_PARENT);
unionfs_lock_dentry(dentry, UNIONFS_DMUTEX_CHILD);
goto out;
unionfs_check_file(file);
+ err = generic_file_fsync(file, start, end, datasync);
+ if (err)
+ goto out;
+
bstart = fbstart(file);
bend = fbend(file);
if (bstart < 0 || bend < 0)
continue;
lower_file = unionfs_lower_file_idx(file, bindex);
lower_dentry = unionfs_lower_dentry_idx(dentry, bindex);
- mutex_lock(&lower_inode->i_mutex);
- err = lower_inode->i_fop->fsync(lower_file, datasync);
+ err = vfs_fsync_range(lower_file, start, end, datasync);
if (!err && bindex == bstart)
fsstack_copy_attr_times(inode, lower_inode);
- mutex_unlock(&lower_inode->i_mutex);
if (err)
goto out;
}
unionfs_unlock_dentry(dentry);
unionfs_unlock_parent(dentry, parent);
unionfs_read_unlock(dentry->d_sb);
+ lockdep_on();
return err;
}
extern int unionfs_flush(struct file *file, fl_owner_t id);
extern long unionfs_ioctl(struct file *file, unsigned int cmd,
unsigned long arg);
-extern int unionfs_fsync(struct file *file, int datasync);
+extern int unionfs_fsync(struct file *file, loff_t start, loff_t end,
+ int datasync);
extern int unionfs_fasync(int fd, struct file *file, int flag);
/* Inode operations */