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

drop unused dentry argument to ->fsync

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>

authored by

Christoph Hellwig and committed by
Al Viro
7ea80859 cc967be5

+129 -157
+1 -1
Documentation/filesystems/Locking
··· 380 380 int (*open) (struct inode *, struct file *); 381 381 int (*flush) (struct file *); 382 382 int (*release) (struct inode *, struct file *); 383 - int (*fsync) (struct file *, struct dentry *, int datasync); 383 + int (*fsync) (struct file *, int datasync); 384 384 int (*aio_fsync) (struct kiocb *, int datasync); 385 385 int (*fasync) (int, struct file *, int); 386 386 int (*lock) (struct file *, int, struct file_lock *);
+1 -1
Documentation/filesystems/vfs.txt
··· 729 729 int (*open) (struct inode *, struct file *); 730 730 int (*flush) (struct file *); 731 731 int (*release) (struct inode *, struct file *); 732 - int (*fsync) (struct file *, struct dentry *, int datasync); 732 + int (*fsync) (struct file *, int datasync); 733 733 int (*aio_fsync) (struct kiocb *, int datasync); 734 734 int (*fasync) (int, struct file *, int); 735 735 int (*lock) (struct file *, int, struct file_lock *);
+1 -2
arch/powerpc/platforms/cell/spufs/file.c
··· 1849 1849 return ret; 1850 1850 } 1851 1851 1852 - static int spufs_mfc_fsync(struct file *file, struct dentry *dentry, 1853 - int datasync) 1852 + static int spufs_mfc_fsync(struct file *file, int datasync) 1854 1853 { 1855 1854 return spufs_mfc_flush(file, NULL); 1856 1855 }
+1 -2
drivers/char/ps3flash.c
··· 305 305 return ps3flash_writeback(ps3flash_dev); 306 306 } 307 307 308 - static int ps3flash_fsync(struct file *file, struct dentry *dentry, 309 - int datasync) 308 + static int ps3flash_fsync(struct file *file, int datasync) 310 309 { 311 310 return ps3flash_writeback(ps3flash_dev); 312 311 }
+1 -2
drivers/mtd/ubi/cdev.c
··· 189 189 return new_offset; 190 190 } 191 191 192 - static int vol_cdev_fsync(struct file *file, struct dentry *dentry, 193 - int datasync) 192 + static int vol_cdev_fsync(struct file *file, int datasync) 194 193 { 195 194 struct ubi_volume_desc *desc = file->private_data; 196 195 struct ubi_device *ubi = desc->vol->ubi;
+1 -1
drivers/staging/pohmelfs/inode.c
··· 880 880 /* 881 881 * We want fsync() to work on POHMELFS. 882 882 */ 883 - static int pohmelfs_fsync(struct file *file, struct dentry *dentry, int datasync) 883 + static int pohmelfs_fsync(struct file *file, int datasync) 884 884 { 885 885 struct inode *inode = file->f_mapping->host; 886 886 struct writeback_control wbc = {
+1 -1
drivers/usb/gadget/printer.c
··· 794 794 } 795 795 796 796 static int 797 - printer_fsync(struct file *fd, struct dentry *dentry, int datasync) 797 + printer_fsync(struct file *fd, int datasync) 798 798 { 799 799 struct printer_dev *dev = fd->private_data; 800 800 unsigned long flags;
+1 -1
drivers/video/fb_defio.c
··· 66 66 return 0; 67 67 } 68 68 69 - int fb_deferred_io_fsync(struct file *file, struct dentry *dentry, int datasync) 69 + int fb_deferred_io_fsync(struct file *file, int datasync) 70 70 { 71 71 struct fb_info *info = file->private_data; 72 72
+2 -4
fs/9p/vfs_file.c
··· 257 257 return total; 258 258 } 259 259 260 - static int v9fs_file_fsync(struct file *filp, struct dentry *dentry, 261 - int datasync) 260 + static int v9fs_file_fsync(struct file *filp, int datasync) 262 261 { 263 262 struct p9_fid *fid; 264 263 struct p9_wstat wstat; 265 264 int retval; 266 265 267 - P9_DPRINTK(P9_DEBUG_VFS, "filp %p dentry %p datasync %x\n", filp, 268 - dentry, datasync); 266 + P9_DPRINTK(P9_DEBUG_VFS, "filp %p datasync %x\n", filp, datasync); 269 267 270 268 fid = filp->private_data; 271 269 v9fs_blank_wstat(&wstat);
+1 -1
fs/affs/affs.h
··· 183 183 184 184 void affs_free_prealloc(struct inode *inode); 185 185 extern void affs_truncate(struct inode *); 186 - int affs_file_fsync(struct file *, struct dentry *, int); 186 + int affs_file_fsync(struct file *, int); 187 187 188 188 /* dir.c */ 189 189
+2 -2
fs/affs/file.c
··· 916 916 affs_free_prealloc(inode); 917 917 } 918 918 919 - int affs_file_fsync(struct file *filp, struct dentry *dentry, int datasync) 919 + int affs_file_fsync(struct file *filp, int datasync) 920 920 { 921 - struct inode * inode = dentry->d_inode; 921 + struct inode *inode = filp->f_mapping->host; 922 922 int ret, err; 923 923 924 924 ret = write_inode_now(inode, 0);
+1 -1
fs/afs/internal.h
··· 740 740 extern ssize_t afs_file_write(struct kiocb *, const struct iovec *, 741 741 unsigned long, loff_t); 742 742 extern int afs_writeback_all(struct afs_vnode *); 743 - extern int afs_fsync(struct file *, struct dentry *, int); 743 + extern int afs_fsync(struct file *, int); 744 744 745 745 746 746 /*****************************************************************************/
+2 -1
fs/afs/write.c
··· 701 701 * - the return status from this call provides a reliable indication of 702 702 * whether any write errors occurred for this process. 703 703 */ 704 - int afs_fsync(struct file *file, struct dentry *dentry, int datasync) 704 + int afs_fsync(struct file *file, int datasync) 705 705 { 706 + struct dentry *dentry = file->f_path.dentry; 706 707 struct afs_writeback *wb, *xwb; 707 708 struct afs_vnode *vnode = AFS_FS_I(dentry->d_inode); 708 709 int ret;
+1 -2
fs/bad_inode.c
··· 93 93 return -EIO; 94 94 } 95 95 96 - static int bad_file_fsync(struct file *file, struct dentry *dentry, 97 - int datasync) 96 + static int bad_file_fsync(struct file *file, int datasync) 98 97 { 99 98 return -EIO; 100 99 }
+1 -6
fs/block_dev.c
··· 358 358 return retval; 359 359 } 360 360 361 - /* 362 - * Filp is never NULL; the only case when ->fsync() is called with 363 - * NULL first argument is nfsd_sync_dir() and that's not a directory. 364 - */ 365 - 366 - int blkdev_fsync(struct file *filp, struct dentry *dentry, int datasync) 361 + int blkdev_fsync(struct file *filp, int datasync) 367 362 { 368 363 struct inode *bd_inode = filp->f_mapping->host; 369 364 struct block_device *bdev = I_BDEV(bd_inode);
+1 -1
fs/btrfs/ctree.h
··· 2434 2434 void btrfs_inherit_iflags(struct inode *inode, struct inode *dir); 2435 2435 2436 2436 /* file.c */ 2437 - int btrfs_sync_file(struct file *file, struct dentry *dentry, int datasync); 2437 + int btrfs_sync_file(struct file *file, int datasync); 2438 2438 int btrfs_drop_extent_cache(struct inode *inode, u64 start, u64 end, 2439 2439 int skip_pinned); 2440 2440 int btrfs_check_file(struct btrfs_root *root, struct inode *inode);
+2 -1
fs/btrfs/file.c
··· 1101 1101 * important optimization for directories because holding the mutex prevents 1102 1102 * new operations on the dir while we write to disk. 1103 1103 */ 1104 - int btrfs_sync_file(struct file *file, struct dentry *dentry, int datasync) 1104 + int btrfs_sync_file(struct file *file, int datasync) 1105 1105 { 1106 + struct dentry *dentry = file->f_path.dentry; 1106 1107 struct inode *inode = dentry->d_inode; 1107 1108 struct btrfs_root *root = BTRFS_I(inode)->root; 1108 1109 int ret = 0;
+2 -2
fs/ceph/caps.c
··· 1776 1776 spin_unlock(&ci->i_unsafe_lock); 1777 1777 } 1778 1778 1779 - int ceph_fsync(struct file *file, struct dentry *dentry, int datasync) 1779 + int ceph_fsync(struct file *file, int datasync) 1780 1780 { 1781 - struct inode *inode = dentry->d_inode; 1781 + struct inode *inode = file->f_mapping->host; 1782 1782 struct ceph_inode_info *ci = ceph_inode(inode); 1783 1783 unsigned flush_tid; 1784 1784 int ret;
+2 -3
fs/ceph/dir.c
··· 1107 1107 * an fsync() on a dir will wait for any uncommitted directory 1108 1108 * operations to commit. 1109 1109 */ 1110 - static int ceph_dir_fsync(struct file *file, struct dentry *dentry, 1111 - int datasync) 1110 + static int ceph_dir_fsync(struct file *file, int datasync) 1112 1111 { 1113 - struct inode *inode = dentry->d_inode; 1112 + struct inode *inode = file->f_path.dentry->d_inode; 1114 1113 struct ceph_inode_info *ci = ceph_inode(inode); 1115 1114 struct list_head *head = &ci->i_unsafe_dirops; 1116 1115 struct ceph_mds_request *req;
+1 -1
fs/ceph/super.h
··· 811 811 812 812 extern void ceph_queue_caps_release(struct inode *inode); 813 813 extern int ceph_write_inode(struct inode *inode, struct writeback_control *wbc); 814 - extern int ceph_fsync(struct file *file, struct dentry *dentry, int datasync); 814 + extern int ceph_fsync(struct file *file, int datasync); 815 815 extern void ceph_kick_flushing_caps(struct ceph_mds_client *mdsc, 816 816 struct ceph_mds_session *session); 817 817 extern int ceph_get_cap_mds(struct inode *inode);
+1 -1
fs/cifs/cifsfs.h
··· 84 84 extern ssize_t cifs_user_write(struct file *file, const char __user *write_data, 85 85 size_t write_size, loff_t *poffset); 86 86 extern int cifs_lock(struct file *, int, struct file_lock *); 87 - extern int cifs_fsync(struct file *, struct dentry *, int); 87 + extern int cifs_fsync(struct file *, int); 88 88 extern int cifs_flush(struct file *, fl_owner_t id); 89 89 extern int cifs_file_mmap(struct file * , struct vm_area_struct *); 90 90 extern const struct file_operations cifs_dir_ops;
+2 -2
fs/cifs/file.c
··· 1676 1676 return rc; 1677 1677 } 1678 1678 1679 - int cifs_fsync(struct file *file, struct dentry *dentry, int datasync) 1679 + int cifs_fsync(struct file *file, int datasync) 1680 1680 { 1681 1681 int xid; 1682 1682 int rc = 0; ··· 1688 1688 xid = GetXid(); 1689 1689 1690 1690 cFYI(1, "Sync file - name: %s datasync: 0x%x", 1691 - dentry->d_name.name, datasync); 1691 + file->f_path.dentry->d_name.name, datasync); 1692 1692 1693 1693 rc = filemap_write_and_wait(inode->i_mapping); 1694 1694 if (rc == 0) {
+1 -2
fs/coda/coda_int.h
··· 11 11 12 12 void coda_destroy_inodecache(void); 13 13 int coda_init_inodecache(void); 14 - int coda_fsync(struct file *coda_file, struct dentry *coda_dentry, 15 - int datasync); 14 + int coda_fsync(struct file *coda_file, int datasync); 16 15 void coda_sysctl_init(void); 17 16 void coda_sysctl_clean(void); 18 17
+2 -2
fs/coda/file.c
··· 202 202 return 0; 203 203 } 204 204 205 - int coda_fsync(struct file *coda_file, struct dentry *coda_dentry, int datasync) 205 + int coda_fsync(struct file *coda_file, int datasync) 206 206 { 207 207 struct file *host_file; 208 - struct inode *coda_inode = coda_dentry->d_inode; 208 + struct inode *coda_inode = coda_file->f_path.dentry->d_inode; 209 209 struct coda_file_info *cfi; 210 210 int err = 0; 211 211
+1 -1
fs/ecryptfs/file.c
··· 274 274 } 275 275 276 276 static int 277 - ecryptfs_fsync(struct file *file, struct dentry *dentry, int datasync) 277 + ecryptfs_fsync(struct file *file, int datasync) 278 278 { 279 279 return vfs_fsync(ecryptfs_file_to_lower(file), datasync); 280 280 }
+3 -4
fs/exofs/file.c
··· 40 40 return 0; 41 41 } 42 42 43 - static int exofs_file_fsync(struct file *filp, struct dentry *dentry, 44 - int datasync) 43 + static int exofs_file_fsync(struct file *filp, int datasync) 45 44 { 46 45 int ret; 47 46 struct address_space *mapping = filp->f_mapping; 48 - struct inode *inode = dentry->d_inode; 47 + struct inode *inode = mapping->host; 49 48 struct super_block *sb; 50 49 51 50 ret = filemap_write_and_wait(mapping); ··· 65 66 66 67 static int exofs_flush(struct file *file, fl_owner_t id) 67 68 { 68 - exofs_file_fsync(file, file->f_path.dentry, 1); 69 + exofs_file_fsync(file, 1); 69 70 /* TODO: Flush the OSD target */ 70 71 return 0; 71 72 }
+1 -1
fs/ext2/ext2.h
··· 155 155 extern const struct file_operations ext2_dir_operations; 156 156 157 157 /* file.c */ 158 - extern int ext2_fsync(struct file *file, struct dentry *dentry, int datasync); 158 + extern int ext2_fsync(struct file *file, int datasync); 159 159 extern const struct inode_operations ext2_file_inode_operations; 160 160 extern const struct file_operations ext2_file_operations; 161 161 extern const struct file_operations ext2_xip_file_operations;
+3 -3
fs/ext2/file.c
··· 40 40 return 0; 41 41 } 42 42 43 - int ext2_fsync(struct file *file, struct dentry *dentry, int datasync) 43 + int ext2_fsync(struct file *file, int datasync) 44 44 { 45 45 int ret; 46 - struct super_block *sb = dentry->d_inode->i_sb; 46 + struct super_block *sb = file->f_mapping->host->i_sb; 47 47 struct address_space *mapping = sb->s_bdev->bd_inode->i_mapping; 48 48 49 - ret = simple_fsync(file, dentry, datasync); 49 + ret = simple_fsync(file, datasync); 50 50 if (ret == -EIO || test_and_clear_bit(AS_EIO, &mapping->flags)) { 51 51 /* We don't really know where the IO error happened... */ 52 52 ext2_error(sb, __func__,
+2 -2
fs/ext3/fsync.c
··· 43 43 * inode to disk. 44 44 */ 45 45 46 - int ext3_sync_file(struct file * file, struct dentry *dentry, int datasync) 46 + int ext3_sync_file(struct file *file, int datasync) 47 47 { 48 - struct inode *inode = dentry->d_inode; 48 + struct inode *inode = file->f_mapping->host; 49 49 struct ext3_inode_info *ei = EXT3_I(inode); 50 50 journal_t *journal = EXT3_SB(inode->i_sb)->s_journal; 51 51 int ret, needs_barrier = 0;
+1 -1
fs/ext4/ext4.h
··· 1519 1519 extern void ext4_htree_free_dir_info(struct dir_private_info *p); 1520 1520 1521 1521 /* fsync.c */ 1522 - extern int ext4_sync_file(struct file *, struct dentry *, int); 1522 + extern int ext4_sync_file(struct file *, int); 1523 1523 1524 1524 /* hash.c */ 1525 1525 extern int ext4fs_dirhash(const char *name, int len, struct
+4 -4
fs/ext4/fsync.c
··· 71 71 * i_mutex lock is held when entering and exiting this function 72 72 */ 73 73 74 - int ext4_sync_file(struct file *file, struct dentry *dentry, int datasync) 74 + int ext4_sync_file(struct file *file, int datasync) 75 75 { 76 - struct inode *inode = dentry->d_inode; 76 + struct inode *inode = file->f_mapping->host; 77 77 struct ext4_inode_info *ei = EXT4_I(inode); 78 78 journal_t *journal = EXT4_SB(inode->i_sb)->s_journal; 79 79 int ret; ··· 81 81 82 82 J_ASSERT(ext4_journal_current_handle() == NULL); 83 83 84 - trace_ext4_sync_file(file, dentry, datasync); 84 + trace_ext4_sync_file(file, datasync); 85 85 86 86 if (inode->i_sb->s_flags & MS_RDONLY) 87 87 return 0; ··· 91 91 return ret; 92 92 93 93 if (!journal) { 94 - ret = simple_fsync(file, dentry, datasync); 94 + ret = simple_fsync(file, datasync); 95 95 if (!ret && !list_empty(&inode->i_dentry)) 96 96 ext4_sync_parent(inode); 97 97 return ret;
+1 -2
fs/fat/fat.h
··· 309 309 extern void fat_truncate(struct inode *inode); 310 310 extern int fat_getattr(struct vfsmount *mnt, struct dentry *dentry, 311 311 struct kstat *stat); 312 - extern int fat_file_fsync(struct file *file, struct dentry *dentry, 313 - int datasync); 312 + extern int fat_file_fsync(struct file *file, int datasync); 314 313 315 314 /* fat/inode.c */ 316 315 extern void fat_attach(struct inode *inode, loff_t i_pos);
+3 -3
fs/fat/file.c
··· 149 149 return 0; 150 150 } 151 151 152 - int fat_file_fsync(struct file *filp, struct dentry *dentry, int datasync) 152 + int fat_file_fsync(struct file *filp, int datasync) 153 153 { 154 - struct inode *inode = dentry->d_inode; 154 + struct inode *inode = filp->f_mapping->host; 155 155 int res, err; 156 156 157 - res = simple_fsync(filp, dentry, datasync); 157 + res = simple_fsync(filp, datasync); 158 158 err = sync_mapping_buffers(MSDOS_SB(inode->i_sb)->fat_inode->i_mapping); 159 159 160 160 return res ? res : err;
+2 -3
fs/fuse/dir.c
··· 1156 1156 return 0; 1157 1157 } 1158 1158 1159 - static int fuse_dir_fsync(struct file *file, struct dentry *de, int datasync) 1159 + static int fuse_dir_fsync(struct file *file, int datasync) 1160 1160 { 1161 - /* nfsd can call this with no file */ 1162 - return file ? fuse_fsync_common(file, de, datasync, 1) : 0; 1161 + return fuse_fsync_common(file, datasync, 1); 1163 1162 } 1164 1163 1165 1164 static bool update_mtime(unsigned ivalid)
+4 -5
fs/fuse/file.c
··· 351 351 fuse_release_nowrite(inode); 352 352 } 353 353 354 - int fuse_fsync_common(struct file *file, struct dentry *de, int datasync, 355 - int isdir) 354 + int fuse_fsync_common(struct file *file, int datasync, int isdir) 356 355 { 357 - struct inode *inode = de->d_inode; 356 + struct inode *inode = file->f_mapping->host; 358 357 struct fuse_conn *fc = get_fuse_conn(inode); 359 358 struct fuse_file *ff = file->private_data; 360 359 struct fuse_req *req; ··· 402 403 return err; 403 404 } 404 405 405 - static int fuse_fsync(struct file *file, struct dentry *de, int datasync) 406 + static int fuse_fsync(struct file *file, int datasync) 406 407 { 407 - return fuse_fsync_common(file, de, datasync, 0); 408 + return fuse_fsync_common(file, datasync, 0); 408 409 } 409 410 410 411 void fuse_read_fill(struct fuse_req *req, struct file *file, loff_t pos,
+1 -2
fs/fuse/fuse_i.h
··· 568 568 /** 569 569 * Send FSYNC or FSYNCDIR request 570 570 */ 571 - int fuse_fsync_common(struct file *file, struct dentry *de, int datasync, 572 - int isdir); 571 + int fuse_fsync_common(struct file *file, int datasync, int isdir); 573 572 574 573 /** 575 574 * Notify poll wakeup
+2 -2
fs/gfs2/file.c
··· 554 554 * Returns: errno 555 555 */ 556 556 557 - static int gfs2_fsync(struct file *file, struct dentry *dentry, int datasync) 557 + static int gfs2_fsync(struct file *file, int datasync) 558 558 { 559 - struct inode *inode = dentry->d_inode; 559 + struct inode *inode = file->f_mapping->host; 560 560 int sync_state = inode->i_state & (I_DIRTY_SYNC|I_DIRTY_DATASYNC); 561 561 int ret = 0; 562 562
+2 -2
fs/hostfs/hostfs_kern.c
··· 411 411 return 0; 412 412 } 413 413 414 - int hostfs_fsync(struct file *file, struct dentry *dentry, int datasync) 414 + int hostfs_fsync(struct file *file, int datasync) 415 415 { 416 - return fsync_file(HOSTFS_I(dentry->d_inode)->fd, datasync); 416 + return fsync_file(HOSTFS_I(file->f_mapping->host)->fd, datasync); 417 417 } 418 418 419 419 static const struct file_operations hostfs_file_fops = {
+2 -2
fs/hpfs/file.c
··· 19 19 return 0; 20 20 } 21 21 22 - int hpfs_file_fsync(struct file *file, struct dentry *dentry, int datasync) 22 + int hpfs_file_fsync(struct file *file, int datasync) 23 23 { 24 - /*return file_fsync(file, dentry);*/ 24 + /*return file_fsync(file, datasync);*/ 25 25 return 0; /* Don't fsync :-) */ 26 26 } 27 27
+1 -1
fs/hpfs/hpfs_fn.h
··· 268 268 269 269 /* file.c */ 270 270 271 - int hpfs_file_fsync(struct file *, struct dentry *, int); 271 + int hpfs_file_fsync(struct file *, int); 272 272 extern const struct file_operations hpfs_file_ops; 273 273 extern const struct inode_operations hpfs_file_iops; 274 274 extern const struct address_space_operations hpfs_aops;
+1 -1
fs/hppfs/hppfs.c
··· 587 587 return err; 588 588 } 589 589 590 - static int hppfs_fsync(struct file *file, struct dentry *dentry, int datasync) 590 + static int hppfs_fsync(struct file *file, int datasync) 591 591 { 592 592 return 0; 593 593 }
+2 -2
fs/jffs2/file.c
··· 26 26 struct page **pagep, void **fsdata); 27 27 static int jffs2_readpage (struct file *filp, struct page *pg); 28 28 29 - int jffs2_fsync(struct file *filp, struct dentry *dentry, int datasync) 29 + int jffs2_fsync(struct file *filp, int datasync) 30 30 { 31 - struct inode *inode = dentry->d_inode; 31 + struct inode *inode = filp->f_mapping->host; 32 32 struct jffs2_sb_info *c = JFFS2_SB_INFO(inode->i_sb); 33 33 34 34 /* Trigger GC to flush any pending writes for this inode */
+1 -1
fs/jffs2/os-linux.h
··· 158 158 extern const struct file_operations jffs2_file_operations; 159 159 extern const struct inode_operations jffs2_file_inode_operations; 160 160 extern const struct address_space_operations jffs2_file_address_operations; 161 - int jffs2_fsync(struct file *, struct dentry *, int); 161 + int jffs2_fsync(struct file *, int); 162 162 int jffs2_do_readpage_unlock (struct inode *inode, struct page *pg); 163 163 164 164 /* ioctl.c */
+2 -2
fs/jfs/file.c
··· 27 27 #include "jfs_acl.h" 28 28 #include "jfs_debug.h" 29 29 30 - int jfs_fsync(struct file *file, struct dentry *dentry, int datasync) 30 + int jfs_fsync(struct file *file, int datasync) 31 31 { 32 - struct inode *inode = dentry->d_inode; 32 + struct inode *inode = file->f_mapping->host; 33 33 int rc = 0; 34 34 35 35 if (!(inode->i_state & I_DIRTY) ||
+1 -1
fs/jfs/jfs_inode.h
··· 21 21 struct fid; 22 22 23 23 extern struct inode *ialloc(struct inode *, umode_t); 24 - extern int jfs_fsync(struct file *, struct dentry *, int); 24 + extern int jfs_fsync(struct file *, int); 25 25 extern long jfs_ioctl(struct file *, unsigned int, unsigned long); 26 26 extern long jfs_compat_ioctl(struct file *, unsigned int, unsigned long); 27 27 extern struct inode *jfs_iget(struct super_block *, unsigned long);
+3 -3
fs/libfs.c
··· 58 58 return NULL; 59 59 } 60 60 61 - int simple_sync_file(struct file * file, struct dentry *dentry, int datasync) 61 + int simple_sync_file(struct file *file, int datasync) 62 62 { 63 63 return 0; 64 64 } ··· 851 851 } 852 852 EXPORT_SYMBOL_GPL(generic_fh_to_parent); 853 853 854 - int simple_fsync(struct file *file, struct dentry *dentry, int datasync) 854 + int simple_fsync(struct file *file, int datasync) 855 855 { 856 856 struct writeback_control wbc = { 857 857 .sync_mode = WB_SYNC_ALL, 858 858 .nr_to_write = 0, /* metadata-only; caller takes care of data */ 859 859 }; 860 - struct inode *inode = dentry->d_inode; 860 + struct inode *inode = file->f_mapping->host; 861 861 int err; 862 862 int ret; 863 863
+2 -2
fs/logfs/file.c
··· 219 219 } 220 220 } 221 221 222 - int logfs_fsync(struct file *file, struct dentry *dentry, int datasync) 222 + int logfs_fsync(struct file *file, int datasync) 223 223 { 224 - struct super_block *sb = dentry->d_inode->i_sb; 224 + struct super_block *sb = file->f_mapping->host->i_sb; 225 225 226 226 logfs_write_anchor(sb); 227 227 return 0;
+1 -1
fs/logfs/logfs.h
··· 506 506 int logfs_readpage(struct file *file, struct page *page); 507 507 int logfs_ioctl(struct inode *inode, struct file *file, unsigned int cmd, 508 508 unsigned long arg); 509 - int logfs_fsync(struct file *file, struct dentry *dentry, int datasync); 509 + int logfs_fsync(struct file *file, int datasync); 510 510 511 511 /* gc.c */ 512 512 u32 get_best_cand(struct super_block *sb, struct candidate_list *list, u32 *ec);
+1 -1
fs/ncpfs/file.c
··· 22 22 #include <linux/ncp_fs.h> 23 23 #include "ncplib_kernel.h" 24 24 25 - static int ncp_fsync(struct file *file, struct dentry *dentry, int datasync) 25 + static int ncp_fsync(struct file *file, int datasync) 26 26 { 27 27 return 0; 28 28 }
+4 -2
fs/nfs/dir.c
··· 53 53 static int nfs_mknod(struct inode *, struct dentry *, int, dev_t); 54 54 static int nfs_rename(struct inode *, struct dentry *, 55 55 struct inode *, struct dentry *); 56 - static int nfs_fsync_dir(struct file *, struct dentry *, int); 56 + static int nfs_fsync_dir(struct file *, int); 57 57 static loff_t nfs_llseek_dir(struct file *, loff_t, int); 58 58 59 59 const struct file_operations nfs_dir_operations = { ··· 641 641 * All directory operations under NFS are synchronous, so fsync() 642 642 * is a dummy operation. 643 643 */ 644 - static int nfs_fsync_dir(struct file *filp, struct dentry *dentry, int datasync) 644 + static int nfs_fsync_dir(struct file *filp, int datasync) 645 645 { 646 + struct dentry *dentry = filp->f_path.dentry; 647 + 646 648 dfprintk(FILE, "NFS: fsync dir(%s/%s) datasync %d\n", 647 649 dentry->d_parent->d_name.name, dentry->d_name.name, 648 650 datasync);
+3 -2
fs/nfs/file.c
··· 53 53 static ssize_t nfs_file_write(struct kiocb *, const struct iovec *iov, 54 54 unsigned long nr_segs, loff_t pos); 55 55 static int nfs_file_flush(struct file *, fl_owner_t id); 56 - static int nfs_file_fsync(struct file *, struct dentry *dentry, int datasync); 56 + static int nfs_file_fsync(struct file *, int datasync); 57 57 static int nfs_check_flags(int flags); 58 58 static int nfs_lock(struct file *filp, int cmd, struct file_lock *fl); 59 59 static int nfs_flock(struct file *filp, int cmd, struct file_lock *fl); ··· 322 322 * whether any write errors occurred for this process. 323 323 */ 324 324 static int 325 - nfs_file_fsync(struct file *file, struct dentry *dentry, int datasync) 325 + nfs_file_fsync(struct file *file, int datasync) 326 326 { 327 + struct dentry *dentry = file->f_path.dentry; 327 328 struct nfs_open_context *ctx = nfs_file_open_context(file); 328 329 struct inode *inode = dentry->d_inode; 329 330
+2 -2
fs/nilfs2/file.c
··· 27 27 #include "nilfs.h" 28 28 #include "segment.h" 29 29 30 - int nilfs_sync_file(struct file *file, struct dentry *dentry, int datasync) 30 + int nilfs_sync_file(struct file *file, int datasync) 31 31 { 32 32 /* 33 33 * Called from fsync() system call ··· 37 37 * This function should be implemented when the writeback function 38 38 * will be implemented. 39 39 */ 40 - struct inode *inode = dentry->d_inode; 40 + struct inode *inode = file->f_mapping->host; 41 41 int err; 42 42 43 43 if (!nilfs_inode_dirty(inode))
+1 -1
fs/nilfs2/nilfs.h
··· 228 228 struct page *, struct inode *); 229 229 230 230 /* file.c */ 231 - extern int nilfs_sync_file(struct file *, struct dentry *, int); 231 + extern int nilfs_sync_file(struct file *, int); 232 232 233 233 /* ioctl.c */ 234 234 long nilfs_ioctl(struct file *, unsigned int, unsigned long);
+2 -3
fs/ntfs/dir.c
··· 1527 1527 * this problem for now. We do write the $BITMAP attribute if it is present 1528 1528 * which is the important one for a directory so things are not too bad. 1529 1529 */ 1530 - static int ntfs_dir_fsync(struct file *filp, struct dentry *dentry, 1531 - int datasync) 1530 + static int ntfs_dir_fsync(struct file *filp, int datasync) 1532 1531 { 1533 - struct inode *bmp_vi, *vi = dentry->d_inode; 1532 + struct inode *bmp_vi, *vi = filp->f_mapping->host; 1534 1533 int err, ret; 1535 1534 ntfs_attr na; 1536 1535
+2 -7
fs/ntfs/file.c
··· 2133 2133 /** 2134 2134 * ntfs_file_fsync - sync a file to disk 2135 2135 * @filp: file to be synced 2136 - * @dentry: dentry describing the file to sync 2137 2136 * @datasync: if non-zero only flush user data and not metadata 2138 2137 * 2139 2138 * Data integrity sync of a file to disk. Used for fsync, fdatasync, and msync ··· 2148 2149 * Also, if @datasync is true, we do not wait on the inode to be written out 2149 2150 * but we always wait on the page cache pages to be written out. 2150 2151 * 2151 - * Note: In the past @filp could be NULL so we ignore it as we don't need it 2152 - * anyway. 2153 - * 2154 2152 * Locking: Caller must hold i_mutex on the inode. 2155 2153 * 2156 2154 * TODO: We should probably also write all attribute/index inodes associated 2157 2155 * with this inode but since we have no simple way of getting to them we ignore 2158 2156 * this problem for now. 2159 2157 */ 2160 - static int ntfs_file_fsync(struct file *filp, struct dentry *dentry, 2161 - int datasync) 2158 + static int ntfs_file_fsync(struct file *filp, int datasync) 2162 2159 { 2163 - struct inode *vi = dentry->d_inode; 2160 + struct inode *vi = filp->f_mapping->host; 2164 2161 int err, ret = 0; 2165 2162 2166 2163 ntfs_debug("Entering for inode 0x%lx.", vi->i_ino);
+3 -4
fs/ocfs2/file.c
··· 175 175 return 0; 176 176 } 177 177 178 - static int ocfs2_sync_file(struct file *file, 179 - struct dentry *dentry, 180 - int datasync) 178 + static int ocfs2_sync_file(struct file *file, int datasync) 181 179 { 182 180 int err = 0; 183 181 journal_t *journal; 184 - struct inode *inode = dentry->d_inode; 182 + struct dentry *dentry = file->f_path.dentry; 183 + struct inode *inode = file->f_mapping->host; 185 184 struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); 186 185 187 186 mlog_entry("(0x%p, 0x%p, %d, '%.*s')\n", file, dentry, datasync,
+3 -5
fs/reiserfs/dir.c
··· 14 14 extern const struct reiserfs_key MIN_KEY; 15 15 16 16 static int reiserfs_readdir(struct file *, void *, filldir_t); 17 - static int reiserfs_dir_fsync(struct file *filp, struct dentry *dentry, 18 - int datasync); 17 + static int reiserfs_dir_fsync(struct file *filp, int datasync); 19 18 20 19 const struct file_operations reiserfs_dir_operations = { 21 20 .llseek = generic_file_llseek, ··· 27 28 #endif 28 29 }; 29 30 30 - static int reiserfs_dir_fsync(struct file *filp, struct dentry *dentry, 31 - int datasync) 31 + static int reiserfs_dir_fsync(struct file *filp, int datasync) 32 32 { 33 - struct inode *inode = dentry->d_inode; 33 + struct inode *inode = filp->f_mapping->host; 34 34 int err; 35 35 reiserfs_write_lock(inode->i_sb); 36 36 err = reiserfs_commit_for_inode(inode);
+2 -3
fs/reiserfs/file.c
··· 134 134 * be removed... 135 135 */ 136 136 137 - static int reiserfs_sync_file(struct file *filp, 138 - struct dentry *dentry, int datasync) 137 + static int reiserfs_sync_file(struct file *filp, int datasync) 139 138 { 140 - struct inode *inode = dentry->d_inode; 139 + struct inode *inode = filp->f_mapping->host; 141 140 int err; 142 141 int barrier_done; 143 142
+2 -1
fs/smbfs/file.c
··· 28 28 #include "proto.h" 29 29 30 30 static int 31 - smb_fsync(struct file *file, struct dentry * dentry, int datasync) 31 + smb_fsync(struct file *file, int datasync) 32 32 { 33 + struct dentry *dentry = file->f_path.dentry; 33 34 struct smb_sb_info *server = server_from_dentry(dentry); 34 35 int result; 35 36
+3 -5
fs/sync.c
··· 130 130 131 131 /* 132 132 * Generic function to fsync a file. 133 - * 134 - * filp may be NULL if called via the msync of a vma. 135 133 */ 136 - int file_fsync(struct file *filp, struct dentry *dentry, int datasync) 134 + int file_fsync(struct file *filp, int datasync) 137 135 { 138 - struct inode * inode = dentry->d_inode; 136 + struct inode *inode = filp->f_mapping->host; 139 137 struct super_block * sb; 140 138 int ret, err; 141 139 ··· 181 183 * livelocks in fsync_buffers_list(). 182 184 */ 183 185 mutex_lock(&mapping->host->i_mutex); 184 - err = file->f_op->fsync(file, file->f_path.dentry, datasync); 186 + err = file->f_op->fsync(file, datasync); 185 187 if (!ret) 186 188 ret = err; 187 189 mutex_unlock(&mapping->host->i_mutex);
+2 -2
fs/ubifs/file.c
··· 1304 1304 return NULL; 1305 1305 } 1306 1306 1307 - int ubifs_fsync(struct file *file, struct dentry *dentry, int datasync) 1307 + int ubifs_fsync(struct file *file, int datasync) 1308 1308 { 1309 - struct inode *inode = dentry->d_inode; 1309 + struct inode *inode = file->f_mapping->host; 1310 1310 struct ubifs_info *c = inode->i_sb->s_fs_info; 1311 1311 int err; 1312 1312
+1 -1
fs/ubifs/ubifs.h
··· 1678 1678 int ubifs_calc_dark(const struct ubifs_info *c, int spc); 1679 1679 1680 1680 /* file.c */ 1681 - int ubifs_fsync(struct file *file, struct dentry *dentry, int datasync); 1681 + int ubifs_fsync(struct file *file, int datasync); 1682 1682 int ubifs_setattr(struct dentry *dentry, struct iattr *attr); 1683 1683 1684 1684 /* dir.c */
+5 -5
fs/xfs/linux-2.6/xfs_file.c
··· 100 100 STATIC int 101 101 xfs_file_fsync( 102 102 struct file *file, 103 - struct dentry *dentry, 104 103 int datasync) 105 104 { 106 - struct xfs_inode *ip = XFS_I(dentry->d_inode); 105 + struct inode *inode = file->f_mapping->host; 106 + struct xfs_inode *ip = XFS_I(inode); 107 107 struct xfs_trans *tp; 108 108 int error = 0; 109 109 int log_flushed = 0; ··· 140 140 * might gets cleared when the inode gets written out via the AIL 141 141 * or xfs_iflush_cluster. 142 142 */ 143 - if (((dentry->d_inode->i_state & I_DIRTY_DATASYNC) || 144 - ((dentry->d_inode->i_state & I_DIRTY_SYNC) && !datasync)) && 143 + if (((inode->i_state & I_DIRTY_DATASYNC) || 144 + ((inode->i_state & I_DIRTY_SYNC) && !datasync)) && 145 145 ip->i_update_core) { 146 146 /* 147 147 * Kick off a transaction to log the inode core to get the ··· 868 868 mutex_lock(&inode->i_mutex); 869 869 xfs_ilock(ip, iolock); 870 870 871 - error2 = -xfs_file_fsync(file, file->f_path.dentry, 871 + error2 = -xfs_file_fsync(file, 872 872 (file->f_flags & __O_SYNC) ? 0 : 1); 873 873 if (!error) 874 874 error = error2;
+1 -1
include/linux/buffer_head.h
··· 224 224 void block_sync_page(struct page *); 225 225 sector_t generic_block_bmap(struct address_space *, sector_t, get_block_t *); 226 226 int block_truncate_page(struct address_space *, loff_t, get_block_t *); 227 - int file_fsync(struct file *, struct dentry *, int); 227 + int file_fsync(struct file *, int); 228 228 int nobh_write_begin(struct file *, struct address_space *, 229 229 loff_t, unsigned, unsigned, 230 230 struct page **, void **, get_block_t*);
+1 -1
include/linux/ext3_fs.h
··· 868 868 extern void ext3_htree_free_dir_info(struct dir_private_info *p); 869 869 870 870 /* fsync.c */ 871 - extern int ext3_sync_file (struct file *, struct dentry *, int); 871 + extern int ext3_sync_file(struct file *, int); 872 872 873 873 /* hash.c */ 874 874 extern int ext3fs_dirhash(const char *name, int len, struct
+1 -4
include/linux/fb.h
··· 4 4 #include <linux/types.h> 5 5 #include <linux/i2c.h> 6 6 7 - struct dentry; 8 - 9 7 /* Definitions of frame buffers */ 10 8 11 9 #define FB_MAX 32 /* sufficient for now */ ··· 1015 1017 struct inode *inode, 1016 1018 struct file *file); 1017 1019 extern void fb_deferred_io_cleanup(struct fb_info *info); 1018 - extern int fb_deferred_io_fsync(struct file *file, struct dentry *dentry, 1019 - int datasync); 1020 + extern int fb_deferred_io_fsync(struct file *file, int datasync); 1020 1021 1021 1022 static inline bool fb_be_math(struct fb_info *info) 1022 1023 {
+4 -4
include/linux/fs.h
··· 1498 1498 int (*open) (struct inode *, struct file *); 1499 1499 int (*flush) (struct file *, fl_owner_t id); 1500 1500 int (*release) (struct inode *, struct file *); 1501 - int (*fsync) (struct file *, struct dentry *, int datasync); 1501 + int (*fsync) (struct file *, int datasync); 1502 1502 int (*aio_fsync) (struct kiocb *, int datasync); 1503 1503 int (*fasync) (int, struct file *, int); 1504 1504 int (*lock) (struct file *, int, struct file_lock *); ··· 2213 2213 /* fs/block_dev.c */ 2214 2214 extern ssize_t blkdev_aio_write(struct kiocb *iocb, const struct iovec *iov, 2215 2215 unsigned long nr_segs, loff_t pos); 2216 - extern int blkdev_fsync(struct file *filp, struct dentry *dentry, int datasync); 2216 + extern int blkdev_fsync(struct file *filp, int datasync); 2217 2217 2218 2218 /* fs/splice.c */ 2219 2219 extern ssize_t generic_file_splice_read(struct file *, loff_t *, ··· 2348 2348 extern int simple_unlink(struct inode *, struct dentry *); 2349 2349 extern int simple_rmdir(struct inode *, struct dentry *); 2350 2350 extern int simple_rename(struct inode *, struct dentry *, struct inode *, struct dentry *); 2351 - extern int simple_sync_file(struct file *, struct dentry *, int); 2351 + extern int simple_sync_file(struct file *, int); 2352 2352 extern int simple_empty(struct dentry *); 2353 2353 extern int simple_readpage(struct file *file, struct page *page); 2354 2354 extern int simple_write_begin(struct file *file, struct address_space *mapping, ··· 2373 2373 extern ssize_t simple_write_to_buffer(void *to, size_t available, loff_t *ppos, 2374 2374 const void __user *from, size_t count); 2375 2375 2376 - extern int simple_fsync(struct file *, struct dentry *, int); 2376 + extern int simple_fsync(struct file *, int); 2377 2377 2378 2378 #ifdef CONFIG_MIGRATION 2379 2379 extern int buffer_migrate_page(struct address_space *,
+4 -2
include/trace/events/ext4.h
··· 606 606 ); 607 607 608 608 TRACE_EVENT(ext4_sync_file, 609 - TP_PROTO(struct file *file, struct dentry *dentry, int datasync), 609 + TP_PROTO(struct file *file, int datasync), 610 610 611 - TP_ARGS(file, dentry, datasync), 611 + TP_ARGS(file, datasync), 612 612 613 613 TP_STRUCT__entry( 614 614 __field( dev_t, dev ) ··· 618 618 ), 619 619 620 620 TP_fast_assign( 621 + struct dentry *dentry = file->f_path.dentry; 622 + 621 623 __entry->dev = dentry->d_inode->i_sb->s_dev; 622 624 __entry->ino = dentry->d_inode->i_ino; 623 625 __entry->datasync = datasync;
+4 -7
ipc/shm.c
··· 273 273 return 0; 274 274 } 275 275 276 - static int shm_fsync(struct file *file, struct dentry *dentry, int datasync) 276 + static int shm_fsync(struct file *file, int datasync) 277 277 { 278 - int (*fsync) (struct file *, struct dentry *, int datasync); 279 278 struct shm_file_data *sfd = shm_file_data(file); 280 - int ret = -EINVAL; 281 279 282 - fsync = sfd->file->f_op->fsync; 283 - if (fsync) 284 - ret = fsync(sfd->file, sfd->file->f_path.dentry, datasync); 285 - return ret; 280 + if (!sfd->file->f_op->fsync) 281 + return -EINVAL; 282 + return sfd->file->f_op->fsync(sfd->file, datasync); 286 283 } 287 284 288 285 static unsigned long shm_get_unmapped_area(struct file *file,