--- c38ec163da6ccba00a0146c75606c1b548b31343 +++ 62f857c284dd06161b14887c3588dd1c5ed0cf72 @@ -18,6 +18,10 @@ #include #include "internal.h" +#ifdef CONFIG_DYNAMIC_FSYNC +extern bool early_suspend_active; +#endif + #define VALID_FLAGS (SYNC_FILE_RANGE_WAIT_BEFORE|SYNC_FILE_RANGE_WRITE| \ SYNC_FILE_RANGE_WAIT_AFTER) @@ -87,7 +91,7 @@ static void sync_one_sb(struct super_blo * Sync all the data for all the filesystems (called by sys_sync() and * emergency sync) */ -static void sync_filesystems(int wait) +void sync_filesystems(int wait) { iterate_supers(sync_one_sb, &wait); } @@ -165,6 +169,12 @@ SYSCALL_DEFINE1(syncfs, int, fd) */ int vfs_fsync_range(struct file *file, loff_t start, loff_t end, int datasync) { +#ifdef CONFIG_DYNAMIC_FSYNC + if (!early_suspend_active) + return 0; + else { +#endif + struct address_space *mapping = file->f_mapping; int err, ret; @@ -187,6 +197,9 @@ int vfs_fsync_range(struct file *file, l out: return ret; +#ifdef CONFIG_DYNAMIC_FSYNC + } +#endif } EXPORT_SYMBOL(vfs_fsync_range); @@ -219,11 +232,21 @@ static int do_fsync(unsigned int fd, int SYSCALL_DEFINE1(fsync, unsigned int, fd) { +#ifdef CONFIG_DYNAMIC_FSYNC + if (!early_suspend_active) + return 0; + else +#endif return do_fsync(fd, 0); } SYSCALL_DEFINE1(fdatasync, unsigned int, fd) { +#ifdef CONFIG_DYNAMIC_FSYNC + if (!early_suspend_active) + return 0; + else +#endif return do_fsync(fd, 1); } @@ -294,6 +317,12 @@ EXPORT_SYMBOL(generic_write_sync); SYSCALL_DEFINE(sync_file_range)(int fd, loff_t offset, loff_t nbytes, unsigned int flags) { +#ifdef CONFIG_DYNAMIC_FSYNC + if (!early_suspend_active) + return 0; + else { +#endif + int ret; struct file *file; struct address_space *mapping; @@ -373,6 +402,9 @@ out_put: fput_light(file, fput_needed); out: return ret; +#ifdef CONFIG_DYNAMIC_FSYNC + } +#endif } #ifdef CONFIG_HAVE_SYSCALL_WRAPPERS asmlinkage long SyS_sync_file_range(long fd, loff_t offset, loff_t nbytes, @@ -389,6 +421,11 @@ SYSCALL_ALIAS(sys_sync_file_range, SyS_s SYSCALL_DEFINE(sync_file_range2)(int fd, unsigned int flags, loff_t offset, loff_t nbytes) { +#ifdef CONFIG_DYNAMIC_FSYNC + if (!early_suspend_active) + return 0; + else +#endif return sys_sync_file_range(fd, offset, nbytes, flags); } #ifdef CONFIG_HAVE_SYSCALL_WRAPPERS