Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

Al Viro e1740a46 b522412a

+6 -66
+1 -1
fs/ext2/Makefile
··· 4 4 5 5 obj-$(CONFIG_EXT2_FS) += ext2.o 6 6 7 - ext2-y := balloc.o dir.o file.o fsync.o ialloc.o inode.o \ 7 + ext2-y := balloc.o dir.o file.o ialloc.o inode.o \ 8 8 ioctl.o namei.o super.o symlink.o 9 9 10 10 ext2-$(CONFIG_EXT2_FS_XATTR) += xattr.o xattr_user.o xattr_trusted.o
+1 -1
fs/ext2/dir.c
··· 720 720 #ifdef CONFIG_COMPAT 721 721 .compat_ioctl = ext2_compat_ioctl, 722 722 #endif 723 - .fsync = ext2_sync_file, 723 + .fsync = simple_fsync, 724 724 };
-3
fs/ext2/ext2.h
··· 113 113 extern struct ext2_dir_entry_2 * ext2_dotdot (struct inode *, struct page **); 114 114 extern void ext2_set_link(struct inode *, struct ext2_dir_entry_2 *, struct page *, struct inode *); 115 115 116 - /* fsync.c */ 117 - extern int ext2_sync_file (struct file *, struct dentry *, int); 118 - 119 116 /* ialloc.c */ 120 117 extern struct inode * ext2_new_inode (struct inode *, int); 121 118 extern void ext2_free_inode (struct inode *);
+2 -2
fs/ext2/file.c
··· 55 55 .mmap = generic_file_mmap, 56 56 .open = generic_file_open, 57 57 .release = ext2_release_file, 58 - .fsync = ext2_sync_file, 58 + .fsync = simple_fsync, 59 59 .splice_read = generic_file_splice_read, 60 60 .splice_write = generic_file_splice_write, 61 61 }; ··· 72 72 .mmap = xip_file_mmap, 73 73 .open = generic_file_open, 74 74 .release = ext2_release_file, 75 - .fsync = ext2_sync_file, 75 + .fsync = simple_fsync, 76 76 }; 77 77 #endif 78 78
-50
fs/ext2/fsync.c
··· 1 - /* 2 - * linux/fs/ext2/fsync.c 3 - * 4 - * Copyright (C) 1993 Stephen Tweedie (sct@dcs.ed.ac.uk) 5 - * from 6 - * Copyright (C) 1992 Remy Card (card@masi.ibp.fr) 7 - * Laboratoire MASI - Institut Blaise Pascal 8 - * Universite Pierre et Marie Curie (Paris VI) 9 - * from 10 - * linux/fs/minix/truncate.c Copyright (C) 1991, 1992 Linus Torvalds 11 - * 12 - * ext2fs fsync primitive 13 - * 14 - * Big-endian to little-endian byte-swapping/bitmaps by 15 - * David S. Miller (davem@caip.rutgers.edu), 1995 16 - * 17 - * Removed unnecessary code duplication for little endian machines 18 - * and excessive __inline__s. 19 - * Andi Kleen, 1997 20 - * 21 - * Major simplications and cleanup - we only need to do the metadata, because 22 - * we can depend on generic_block_fdatasync() to sync the data blocks. 23 - */ 24 - 25 - #include "ext2.h" 26 - #include <linux/buffer_head.h> /* for sync_mapping_buffers() */ 27 - 28 - 29 - /* 30 - * File may be NULL when we are called. Perhaps we shouldn't 31 - * even pass file to fsync ? 32 - */ 33 - 34 - int ext2_sync_file(struct file *file, struct dentry *dentry, int datasync) 35 - { 36 - struct inode *inode = dentry->d_inode; 37 - int err; 38 - int ret; 39 - 40 - ret = sync_mapping_buffers(inode->i_mapping); 41 - if (!(inode->i_state & I_DIRTY)) 42 - return ret; 43 - if (datasync && !(inode->i_state & I_DIRTY_DATASYNC)) 44 - return ret; 45 - 46 - err = ext2_sync_inode(inode); 47 - if (ret == 0) 48 - ret = err; 49 - return ret; 50 - }
+2 -9
fs/ext2/inode.c
··· 41 41 MODULE_DESCRIPTION("Second Extended Filesystem"); 42 42 MODULE_LICENSE("GPL"); 43 43 44 - static int ext2_update_inode(struct inode * inode, int do_sync); 45 - 46 44 /* 47 45 * Test whether an inode is a fast symlink. 48 46 */ ··· 64 66 goto no_delete; 65 67 EXT2_I(inode)->i_dtime = get_seconds(); 66 68 mark_inode_dirty(inode); 67 - ext2_update_inode(inode, inode_needs_sync(inode)); 69 + ext2_write_inode(inode, inode_needs_sync(inode)); 68 70 69 71 inode->i_size = 0; 70 72 if (inode->i_blocks) ··· 1335 1337 return ERR_PTR(ret); 1336 1338 } 1337 1339 1338 - static int ext2_update_inode(struct inode * inode, int do_sync) 1340 + int ext2_write_inode(struct inode *inode, int do_sync) 1339 1341 { 1340 1342 struct ext2_inode_info *ei = EXT2_I(inode); 1341 1343 struct super_block *sb = inode->i_sb; ··· 1438 1440 ei->i_state &= ~EXT2_STATE_NEW; 1439 1441 brelse (bh); 1440 1442 return err; 1441 - } 1442 - 1443 - int ext2_write_inode(struct inode *inode, int wait) 1444 - { 1445 - return ext2_update_inode(inode, wait); 1446 1443 } 1447 1444 1448 1445 int ext2_sync_inode(struct inode *inode)