UPDATES: add support for cpu alignment, fix makefile, make changes to f/sync
/fs/sync.c
blob:8e4108feb5a1616f679196e8e4920cef4f8cafc8 -> blob:c38ec163da6ccba00a0146c75606c1b548b31343
--- fs/sync.c
+++ fs/sync.c
@@ -18,10 +18,6 @@
#include <linux/backing-dev.h>
#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)
@@ -91,7 +87,7 @@ static void sync_one_sb(struct super_blo
* Sync all the data for all the filesystems (called by sys_sync() and
* emergency sync)
*/
-void sync_filesystems(int wait)
+static void sync_filesystems(int wait)
{
iterate_supers(sync_one_sb, &wait);
}
@@ -143,10 +139,6 @@ 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;
@@ -173,12 +165,6 @@ 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;
@@ -201,9 +187,6 @@ int vfs_fsync_range(struct file *file, l
out:
return ret;
-#ifdef CONFIG_DYNAMIC_FSYNC
- }
-#endif
}
EXPORT_SYMBOL(vfs_fsync_range);
@@ -225,33 +208,22 @@ static int do_fsync(unsigned int fd, int
{
struct file *file;
int ret = -EBADF;
- int fput_needed;
- file = fget_light(fd, &fput_needed);
+ file = fget(fd);
if (file) {
ret = vfs_fsync(file, datasync);
- fput_light(file, fput_needed);
+ fput(file);
}
return ret;
}
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);
}
@@ -265,10 +237,6 @@ 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,
@@ -326,12 +294,6 @@ 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;
@@ -411,9 +373,6 @@ 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,
@@ -430,11 +389,6 @@ 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