Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 199173
b: refs/heads/master
c: 1b061d9
h: refs/heads/master
i:
  199171: aaa2b4a
v: v3
  • Loading branch information
Christoph Hellwig authored and Al Viro committed May 28, 2010
1 parent 5de8c5b commit b7969d0
Show file tree
Hide file tree
Showing 24 changed files with 45 additions and 33 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7ea8085910ef3dd4f3cad6845aaa2b580d39b115
refs/heads/master: 1b061d9247f71cd15edc4c4c4600191a903642c0
2 changes: 1 addition & 1 deletion trunk/arch/powerpc/platforms/cell/spufs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ const struct file_operations spufs_context_fops = {
.llseek = dcache_dir_lseek,
.read = generic_read_dir,
.readdir = dcache_readdir,
.fsync = simple_sync_file,
.fsync = noop_fsync,
};
EXPORT_SYMBOL_GPL(spufs_context_fops);

Expand Down
2 changes: 1 addition & 1 deletion trunk/fs/adfs/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ const struct file_operations adfs_dir_operations = {
.read = generic_read_dir,
.llseek = generic_file_llseek,
.readdir = adfs_readdir,
.fsync = simple_fsync,
.fsync = generic_file_fsync,
};

static int
Expand Down
2 changes: 1 addition & 1 deletion trunk/fs/adfs/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const struct file_operations adfs_file_operations = {
.read = do_sync_read,
.aio_read = generic_file_aio_read,
.mmap = generic_file_mmap,
.fsync = simple_fsync,
.fsync = generic_file_fsync,
.write = do_sync_write,
.aio_write = generic_file_aio_write,
.splice_read = generic_file_splice_read,
Expand Down
2 changes: 1 addition & 1 deletion trunk/fs/bfs/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ static int bfs_readdir(struct file *f, void *dirent, filldir_t filldir)
const struct file_operations bfs_dir_operations = {
.read = generic_read_dir,
.readdir = bfs_readdir,
.fsync = simple_fsync,
.fsync = generic_file_fsync,
.llseek = generic_file_llseek,
};

Expand Down
2 changes: 1 addition & 1 deletion trunk/fs/ext2/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ int ext2_fsync(struct file *file, int datasync)
struct super_block *sb = file->f_mapping->host->i_sb;
struct address_space *mapping = sb->s_bdev->bd_inode->i_mapping;

ret = simple_fsync(file, datasync);
ret = generic_file_fsync(file, datasync);
if (ret == -EIO || test_and_clear_bit(AS_EIO, &mapping->flags)) {
/* We don't really know where the IO error happened... */
ext2_error(sb, __func__,
Expand Down
2 changes: 1 addition & 1 deletion trunk/fs/ext4/fsync.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ int ext4_sync_file(struct file *file, int datasync)
return ret;

if (!journal) {
ret = simple_fsync(file, datasync);
ret = generic_file_fsync(file, datasync);
if (!ret && !list_empty(&inode->i_dentry))
ext4_sync_parent(inode);
return ret;
Expand Down
2 changes: 1 addition & 1 deletion trunk/fs/fat/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ int fat_file_fsync(struct file *filp, int datasync)
struct inode *inode = filp->f_mapping->host;
int res, err;

res = simple_fsync(filp, datasync);
res = generic_file_fsync(filp, datasync);
err = sync_mapping_buffers(MSDOS_SB(inode->i_sb)->fat_inode->i_mapping);

return res ? res : err;
Expand Down
2 changes: 1 addition & 1 deletion trunk/fs/hugetlbfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -688,7 +688,7 @@ static void init_once(void *foo)
const struct file_operations hugetlbfs_file_operations = {
.read = hugetlbfs_read,
.mmap = hugetlbfs_file_mmap,
.fsync = simple_sync_file,
.fsync = noop_fsync,
.get_unmapped_area = hugetlb_get_unmapped_area,
};

Expand Down
30 changes: 21 additions & 9 deletions trunk/fs/libfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,6 @@ struct dentry *simple_lookup(struct inode *dir, struct dentry *dentry, struct na
return NULL;
}

int simple_sync_file(struct file *file, int datasync)
{
return 0;
}

int dcache_dir_open(struct inode *inode, struct file *file)
{
static struct qstr cursor_name = {.len = 1, .name = "."};
Expand Down Expand Up @@ -190,7 +185,7 @@ const struct file_operations simple_dir_operations = {
.llseek = dcache_dir_lseek,
.read = generic_read_dir,
.readdir = dcache_readdir,
.fsync = simple_sync_file,
.fsync = noop_fsync,
};

const struct inode_operations simple_dir_inode_operations = {
Expand Down Expand Up @@ -851,7 +846,16 @@ struct dentry *generic_fh_to_parent(struct super_block *sb, struct fid *fid,
}
EXPORT_SYMBOL_GPL(generic_fh_to_parent);

int simple_fsync(struct file *file, int datasync)
/**
* generic_file_fsync - generic fsync implementation for simple filesystems
* @file: file to synchronize
* @datasync: only synchronize essential metadata if true
*
* This is a generic implementation of the fsync method for simple
* filesystems which track all non-inode metadata in the buffers list
* hanging off the address_space structure.
*/
int generic_file_fsync(struct file *file, int datasync)
{
struct writeback_control wbc = {
.sync_mode = WB_SYNC_ALL,
Expand All @@ -872,7 +876,15 @@ int simple_fsync(struct file *file, int datasync)
ret = err;
return ret;
}
EXPORT_SYMBOL(simple_fsync);
EXPORT_SYMBOL(generic_file_fsync);

/*
* No-op implementation of ->fsync for in-memory filesystems.
*/
int noop_fsync(struct file *file, int datasync)
{
return 0;
}

EXPORT_SYMBOL(dcache_dir_close);
EXPORT_SYMBOL(dcache_dir_lseek);
Expand All @@ -895,7 +907,7 @@ EXPORT_SYMBOL(simple_release_fs);
EXPORT_SYMBOL(simple_rename);
EXPORT_SYMBOL(simple_rmdir);
EXPORT_SYMBOL(simple_statfs);
EXPORT_SYMBOL(simple_sync_file);
EXPORT_SYMBOL(noop_fsync);
EXPORT_SYMBOL(simple_unlink);
EXPORT_SYMBOL(simple_read_from_buffer);
EXPORT_SYMBOL(simple_write_to_buffer);
Expand Down
2 changes: 1 addition & 1 deletion trunk/fs/minix/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const struct file_operations minix_dir_operations = {
.llseek = generic_file_llseek,
.read = generic_read_dir,
.readdir = minix_readdir,
.fsync = simple_fsync,
.fsync = generic_file_fsync,
};

static inline void dir_put_page(struct page *page)
Expand Down
2 changes: 1 addition & 1 deletion trunk/fs/minix/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const struct file_operations minix_file_operations = {
.write = do_sync_write,
.aio_write = generic_file_aio_write,
.mmap = generic_file_mmap,
.fsync = simple_fsync,
.fsync = generic_file_fsync,
.splice_read = generic_file_splice_read,
};

Expand Down
2 changes: 1 addition & 1 deletion trunk/fs/omfs/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ const struct file_operations omfs_file_operations = {
.aio_read = generic_file_aio_read,
.aio_write = generic_file_aio_write,
.mmap = generic_file_mmap,
.fsync = simple_fsync,
.fsync = generic_file_fsync,
.splice_read = generic_file_splice_read,
};

Expand Down
2 changes: 1 addition & 1 deletion trunk/fs/qnx4/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ const struct file_operations qnx4_dir_operations =
.llseek = generic_file_llseek,
.read = generic_read_dir,
.readdir = qnx4_readdir,
.fsync = simple_fsync,
.fsync = generic_file_fsync,
};

const struct inode_operations qnx4_dir_inode_operations =
Expand Down
2 changes: 1 addition & 1 deletion trunk/fs/ramfs/file-mmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const struct file_operations ramfs_file_operations = {
.write = do_sync_write,
.aio_write = generic_file_aio_write,
.mmap = generic_file_mmap,
.fsync = simple_sync_file,
.fsync = noop_fsync,
.splice_read = generic_file_splice_read,
.splice_write = generic_file_splice_write,
.llseek = generic_file_llseek,
Expand Down
2 changes: 1 addition & 1 deletion trunk/fs/ramfs/file-nommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const struct file_operations ramfs_file_operations = {
.aio_read = generic_file_aio_read,
.write = do_sync_write,
.aio_write = generic_file_aio_write,
.fsync = simple_sync_file,
.fsync = noop_fsync,
.splice_read = generic_file_splice_read,
.splice_write = generic_file_splice_write,
.llseek = generic_file_llseek,
Expand Down
2 changes: 1 addition & 1 deletion trunk/fs/sysv/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const struct file_operations sysv_dir_operations = {
.llseek = generic_file_llseek,
.read = generic_read_dir,
.readdir = sysv_readdir,
.fsync = simple_fsync,
.fsync = generic_file_fsync,
};

static inline void dir_put_page(struct page *page)
Expand Down
2 changes: 1 addition & 1 deletion trunk/fs/sysv/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const struct file_operations sysv_file_operations = {
.write = do_sync_write,
.aio_write = generic_file_aio_write,
.mmap = generic_file_mmap,
.fsync = simple_fsync,
.fsync = generic_file_fsync,
.splice_read = generic_file_splice_read,
};

Expand Down
2 changes: 1 addition & 1 deletion trunk/fs/udf/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -211,5 +211,5 @@ const struct file_operations udf_dir_operations = {
.read = generic_read_dir,
.readdir = udf_readdir,
.unlocked_ioctl = udf_ioctl,
.fsync = simple_fsync,
.fsync = generic_file_fsync,
};
2 changes: 1 addition & 1 deletion trunk/fs/udf/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ const struct file_operations udf_file_operations = {
.write = do_sync_write,
.aio_write = udf_file_aio_write,
.release = udf_release_file,
.fsync = simple_fsync,
.fsync = generic_file_fsync,
.splice_read = generic_file_splice_read,
.llseek = generic_file_llseek,
};
Expand Down
2 changes: 1 addition & 1 deletion trunk/fs/ufs/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -666,6 +666,6 @@ int ufs_empty_dir(struct inode * inode)
const struct file_operations ufs_dir_operations = {
.read = generic_read_dir,
.readdir = ufs_readdir,
.fsync = simple_fsync,
.fsync = generic_file_fsync,
.llseek = generic_file_llseek,
};
2 changes: 1 addition & 1 deletion trunk/fs/ufs/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,6 @@ const struct file_operations ufs_file_operations = {
.aio_write = generic_file_aio_write,
.mmap = generic_file_mmap,
.open = dquot_file_open,
.fsync = simple_fsync,
.fsync = generic_file_fsync,
.splice_read = generic_file_splice_read,
};
4 changes: 2 additions & 2 deletions trunk/include/linux/fs.h
Original file line number Diff line number Diff line change
Expand Up @@ -2348,7 +2348,7 @@ extern int simple_link(struct dentry *, struct inode *, struct dentry *);
extern int simple_unlink(struct inode *, struct dentry *);
extern int simple_rmdir(struct inode *, struct dentry *);
extern int simple_rename(struct inode *, struct dentry *, struct inode *, struct dentry *);
extern int simple_sync_file(struct file *, int);
extern int noop_fsync(struct file *, int);
extern int simple_empty(struct dentry *);
extern int simple_readpage(struct file *file, struct page *page);
extern int simple_write_begin(struct file *file, struct address_space *mapping,
Expand All @@ -2373,7 +2373,7 @@ extern ssize_t simple_read_from_buffer(void __user *to, size_t count,
extern ssize_t simple_write_to_buffer(void *to, size_t available, loff_t *ppos,
const void __user *from, size_t count);

extern int simple_fsync(struct file *, int);
extern int generic_file_fsync(struct file *, int);

#ifdef CONFIG_MIGRATION
extern int buffer_migrate_page(struct address_space *,
Expand Down
2 changes: 1 addition & 1 deletion trunk/mm/shmem.c
Original file line number Diff line number Diff line change
Expand Up @@ -2433,7 +2433,7 @@ static const struct file_operations shmem_file_operations = {
.write = do_sync_write,
.aio_read = shmem_file_aio_read,
.aio_write = generic_file_aio_write,
.fsync = simple_sync_file,
.fsync = noop_fsync,
.splice_read = generic_file_splice_read,
.splice_write = generic_file_splice_write,
#endif
Expand Down

0 comments on commit b7969d0

Please sign in to comment.