FILESYSTEM: dynamic f/sync
/fs/sync.c
blob:62f857c284dd06161b14887c3588dd1c5ed0cf72 -> blob:8e4108feb5a1616f679196e8e4920cef4f8cafc8
--- fs/sync.c
+++ fs/sync.c
@@ -143,6 +143,10 @@ SYSCALL_DEFINE1(syncfs, int, fd)
int ret;
int fput_needed;
+#ifdef CONFIG_DYNAMIC_FSYNC
+ if (!early_suspend_active)
+ return 0;
+#endif
file = fget_light(fd, &fput_needed);
if (!file)
return -EBADF;
@@ -221,11 +225,12 @@ static int do_fsync(unsigned int fd, int
{
struct file *file;
int ret = -EBADF;
+ int fput_needed;
- file = fget(fd);
+ file = fget_light(fd, &fput_needed);
if (file) {
ret = vfs_fsync(file, datasync);
- fput(file);
+ fput_light(file, fput_needed);
}
return ret;
}
@@ -260,6 +265,10 @@ SYSCALL_DEFINE1(fdatasync, unsigned int,
*/
int generic_write_sync(struct file *file, loff_t pos, loff_t count)
{
+#ifdef CONFIG_DYNAMIC_FSYNC
+ if (!early_suspend_active)
+ return 0;
+#endif
if (!(file->f_flags & O_DSYNC) && !IS_SYNC(file->f_mapping->host))
return 0;
return vfs_fsync_range(file, pos, pos + count - 1,