mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-03-30 19:15:14 +00:00
switch ext2 to simple_fsync()
kill ext2_sync_file() (along with ext2/fsync.c), get rid of ext2_update_inode() - it's an alias of ext2_write_inode(). Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
parent
b522412aea
commit
e1740a462e
6 changed files with 6 additions and 66 deletions
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
obj-$(CONFIG_EXT2_FS) += ext2.o
|
obj-$(CONFIG_EXT2_FS) += ext2.o
|
||||||
|
|
||||||
ext2-y := balloc.o dir.o file.o fsync.o ialloc.o inode.o \
|
ext2-y := balloc.o dir.o file.o ialloc.o inode.o \
|
||||||
ioctl.o namei.o super.o symlink.o
|
ioctl.o namei.o super.o symlink.o
|
||||||
|
|
||||||
ext2-$(CONFIG_EXT2_FS_XATTR) += xattr.o xattr_user.o xattr_trusted.o
|
ext2-$(CONFIG_EXT2_FS_XATTR) += xattr.o xattr_user.o xattr_trusted.o
|
||||||
|
|
|
@ -720,5 +720,5 @@ const struct file_operations ext2_dir_operations = {
|
||||||
#ifdef CONFIG_COMPAT
|
#ifdef CONFIG_COMPAT
|
||||||
.compat_ioctl = ext2_compat_ioctl,
|
.compat_ioctl = ext2_compat_ioctl,
|
||||||
#endif
|
#endif
|
||||||
.fsync = ext2_sync_file,
|
.fsync = simple_fsync,
|
||||||
};
|
};
|
||||||
|
|
|
@ -113,9 +113,6 @@ extern int ext2_empty_dir (struct inode *);
|
||||||
extern struct ext2_dir_entry_2 * ext2_dotdot (struct inode *, struct page **);
|
extern struct ext2_dir_entry_2 * ext2_dotdot (struct inode *, struct page **);
|
||||||
extern void ext2_set_link(struct inode *, struct ext2_dir_entry_2 *, struct page *, struct inode *);
|
extern void ext2_set_link(struct inode *, struct ext2_dir_entry_2 *, struct page *, struct inode *);
|
||||||
|
|
||||||
/* fsync.c */
|
|
||||||
extern int ext2_sync_file (struct file *, struct dentry *, int);
|
|
||||||
|
|
||||||
/* ialloc.c */
|
/* ialloc.c */
|
||||||
extern struct inode * ext2_new_inode (struct inode *, int);
|
extern struct inode * ext2_new_inode (struct inode *, int);
|
||||||
extern void ext2_free_inode (struct inode *);
|
extern void ext2_free_inode (struct inode *);
|
||||||
|
|
|
@ -55,7 +55,7 @@ const struct file_operations ext2_file_operations = {
|
||||||
.mmap = generic_file_mmap,
|
.mmap = generic_file_mmap,
|
||||||
.open = generic_file_open,
|
.open = generic_file_open,
|
||||||
.release = ext2_release_file,
|
.release = ext2_release_file,
|
||||||
.fsync = ext2_sync_file,
|
.fsync = simple_fsync,
|
||||||
.splice_read = generic_file_splice_read,
|
.splice_read = generic_file_splice_read,
|
||||||
.splice_write = generic_file_splice_write,
|
.splice_write = generic_file_splice_write,
|
||||||
};
|
};
|
||||||
|
@ -72,7 +72,7 @@ const struct file_operations ext2_xip_file_operations = {
|
||||||
.mmap = xip_file_mmap,
|
.mmap = xip_file_mmap,
|
||||||
.open = generic_file_open,
|
.open = generic_file_open,
|
||||||
.release = ext2_release_file,
|
.release = ext2_release_file,
|
||||||
.fsync = ext2_sync_file,
|
.fsync = simple_fsync,
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -1,50 +0,0 @@
|
||||||
/*
|
|
||||||
* linux/fs/ext2/fsync.c
|
|
||||||
*
|
|
||||||
* Copyright (C) 1993 Stephen Tweedie (sct@dcs.ed.ac.uk)
|
|
||||||
* from
|
|
||||||
* Copyright (C) 1992 Remy Card (card@masi.ibp.fr)
|
|
||||||
* Laboratoire MASI - Institut Blaise Pascal
|
|
||||||
* Universite Pierre et Marie Curie (Paris VI)
|
|
||||||
* from
|
|
||||||
* linux/fs/minix/truncate.c Copyright (C) 1991, 1992 Linus Torvalds
|
|
||||||
*
|
|
||||||
* ext2fs fsync primitive
|
|
||||||
*
|
|
||||||
* Big-endian to little-endian byte-swapping/bitmaps by
|
|
||||||
* David S. Miller (davem@caip.rutgers.edu), 1995
|
|
||||||
*
|
|
||||||
* Removed unnecessary code duplication for little endian machines
|
|
||||||
* and excessive __inline__s.
|
|
||||||
* Andi Kleen, 1997
|
|
||||||
*
|
|
||||||
* Major simplications and cleanup - we only need to do the metadata, because
|
|
||||||
* we can depend on generic_block_fdatasync() to sync the data blocks.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "ext2.h"
|
|
||||||
#include <linux/buffer_head.h> /* for sync_mapping_buffers() */
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* File may be NULL when we are called. Perhaps we shouldn't
|
|
||||||
* even pass file to fsync ?
|
|
||||||
*/
|
|
||||||
|
|
||||||
int ext2_sync_file(struct file *file, struct dentry *dentry, int datasync)
|
|
||||||
{
|
|
||||||
struct inode *inode = dentry->d_inode;
|
|
||||||
int err;
|
|
||||||
int ret;
|
|
||||||
|
|
||||||
ret = sync_mapping_buffers(inode->i_mapping);
|
|
||||||
if (!(inode->i_state & I_DIRTY))
|
|
||||||
return ret;
|
|
||||||
if (datasync && !(inode->i_state & I_DIRTY_DATASYNC))
|
|
||||||
return ret;
|
|
||||||
|
|
||||||
err = ext2_sync_inode(inode);
|
|
||||||
if (ret == 0)
|
|
||||||
ret = err;
|
|
||||||
return ret;
|
|
||||||
}
|
|
|
@ -41,8 +41,6 @@ MODULE_AUTHOR("Remy Card and others");
|
||||||
MODULE_DESCRIPTION("Second Extended Filesystem");
|
MODULE_DESCRIPTION("Second Extended Filesystem");
|
||||||
MODULE_LICENSE("GPL");
|
MODULE_LICENSE("GPL");
|
||||||
|
|
||||||
static int ext2_update_inode(struct inode * inode, int do_sync);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Test whether an inode is a fast symlink.
|
* Test whether an inode is a fast symlink.
|
||||||
*/
|
*/
|
||||||
|
@ -66,7 +64,7 @@ void ext2_delete_inode (struct inode * inode)
|
||||||
goto no_delete;
|
goto no_delete;
|
||||||
EXT2_I(inode)->i_dtime = get_seconds();
|
EXT2_I(inode)->i_dtime = get_seconds();
|
||||||
mark_inode_dirty(inode);
|
mark_inode_dirty(inode);
|
||||||
ext2_update_inode(inode, inode_needs_sync(inode));
|
ext2_write_inode(inode, inode_needs_sync(inode));
|
||||||
|
|
||||||
inode->i_size = 0;
|
inode->i_size = 0;
|
||||||
if (inode->i_blocks)
|
if (inode->i_blocks)
|
||||||
|
@ -1337,7 +1335,7 @@ bad_inode:
|
||||||
return ERR_PTR(ret);
|
return ERR_PTR(ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ext2_update_inode(struct inode * inode, int do_sync)
|
int ext2_write_inode(struct inode *inode, int do_sync)
|
||||||
{
|
{
|
||||||
struct ext2_inode_info *ei = EXT2_I(inode);
|
struct ext2_inode_info *ei = EXT2_I(inode);
|
||||||
struct super_block *sb = inode->i_sb;
|
struct super_block *sb = inode->i_sb;
|
||||||
|
@ -1442,11 +1440,6 @@ static int ext2_update_inode(struct inode * inode, int do_sync)
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
int ext2_write_inode(struct inode *inode, int wait)
|
|
||||||
{
|
|
||||||
return ext2_update_inode(inode, wait);
|
|
||||||
}
|
|
||||||
|
|
||||||
int ext2_sync_inode(struct inode *inode)
|
int ext2_sync_inode(struct inode *inode)
|
||||||
{
|
{
|
||||||
struct writeback_control wbc = {
|
struct writeback_control wbc = {
|
||||||
|
|
Loading…
Add table
Reference in a new issue