Skip to content

Commit

Permalink
Revert "fs: implement fsync_enable module"
Browse files Browse the repository at this point in the history
This reverts commit 8ad5c32.
  • Loading branch information
garwedgess committed Jun 18, 2013
1 parent 003fa82 commit e0e8a96
Showing 1 changed file with 0 additions and 24 deletions.
24 changes: 0 additions & 24 deletions fs/sync.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@
#include <linux/buffer_head.h>
#include "internal.h"

bool fsync_enabled = false;
module_param(fsync_enabled, bool, 0755);

#define VALID_FLAGS (SYNC_FILE_RANGE_WAIT_BEFORE|SYNC_FILE_RANGE_WRITE| \
SYNC_FILE_RANGE_WAIT_AFTER)

Expand Down Expand Up @@ -211,9 +208,6 @@ int vfs_fsync_range(struct file *file, struct dentry *dentry, loff_t start,
struct address_space *mapping;
int err, ret;

if (!fsync_enabled)
return 0;

/*
* Get mapping and operations from the file in case we have
* as file, or get the default values for them in case we
Expand Down Expand Up @@ -264,9 +258,6 @@ EXPORT_SYMBOL(vfs_fsync_range);
*/
int vfs_fsync(struct file *file, struct dentry *dentry, int datasync)
{
if (!fsync_enabled)
return 0;

return vfs_fsync_range(file, dentry, 0, LLONG_MAX, datasync);
}
EXPORT_SYMBOL(vfs_fsync);
Expand All @@ -276,9 +267,6 @@ static int do_fsync(unsigned int fd, int datasync)
struct file *file;
int ret = -EBADF;

if (!fsync_enabled)
return 0;

file = fget(fd);
if (file) {
ret = vfs_fsync(file, file->f_path.dentry, datasync);
Expand All @@ -289,17 +277,11 @@ static int do_fsync(unsigned int fd, int datasync)

SYSCALL_DEFINE1(fsync, unsigned int, fd)
{
if (!fsync_enabled)
return 0;

return do_fsync(fd, 0);
}

SYSCALL_DEFINE1(fdatasync, unsigned int, fd)
{
if (!fsync_enabled)
return 0;

return do_fsync(fd, 1);
}

Expand All @@ -313,9 +295,6 @@ SYSCALL_DEFINE1(fdatasync, unsigned int, fd)
*/
int generic_write_sync(struct file *file, loff_t pos, loff_t count)
{
if (!fsync_enabled)
return 0;

if (!(file->f_flags & O_SYNC) && !IS_SYNC(file->f_mapping->host))
return 0;
return vfs_fsync_range(file, file->f_path.dentry, pos,
Expand Down Expand Up @@ -379,9 +358,6 @@ SYSCALL_DEFINE(sync_file_range)(int fd, loff_t offset, loff_t nbytes,
int fput_needed;
umode_t i_mode;

if (!fsync_enabled)
return 0;

ret = -EINVAL;
if (flags & ~VALID_FLAGS)
goto out;
Expand Down

0 comments on commit e0e8a96

Please sign in to comment.