···380380 int (*open) (struct inode *, struct file *);381381 int (*flush) (struct file *);382382 int (*release) (struct inode *, struct file *);383383- int (*fsync) (struct file *, struct dentry *, int datasync);383383+ int (*fsync) (struct file *, int datasync);384384 int (*aio_fsync) (struct kiocb *, int datasync);385385 int (*fasync) (int, struct file *, int);386386 int (*lock) (struct file *, int, struct file_lock *);
+1-1
Documentation/filesystems/vfs.txt
···729729 int (*open) (struct inode *, struct file *);730730 int (*flush) (struct file *);731731 int (*release) (struct inode *, struct file *);732732- int (*fsync) (struct file *, struct dentry *, int datasync);732732+ int (*fsync) (struct file *, int datasync);733733 int (*aio_fsync) (struct kiocb *, int datasync);734734 int (*fasync) (int, struct file *, int);735735 int (*lock) (struct file *, int, struct file_lock *);
+1-2
arch/powerpc/platforms/cell/spufs/file.c
···18491849 return ret;18501850}1851185118521852-static int spufs_mfc_fsync(struct file *file, struct dentry *dentry,18531853- int datasync)18521852+static int spufs_mfc_fsync(struct file *file, int datasync)18541853{18551854 return spufs_mfc_flush(file, NULL);18561855}
+1-2
drivers/char/ps3flash.c
···305305 return ps3flash_writeback(ps3flash_dev);306306}307307308308-static int ps3flash_fsync(struct file *file, struct dentry *dentry,309309- int datasync)308308+static int ps3flash_fsync(struct file *file, int datasync)310309{311310 return ps3flash_writeback(ps3flash_dev);312311}
+1-2
drivers/mtd/ubi/cdev.c
···189189 return new_offset;190190}191191192192-static int vol_cdev_fsync(struct file *file, struct dentry *dentry,193193- int datasync)192192+static int vol_cdev_fsync(struct file *file, int datasync)194193{195194 struct ubi_volume_desc *desc = file->private_data;196195 struct ubi_device *ubi = desc->vol->ubi;
+1-1
drivers/staging/pohmelfs/inode.c
···880880/*881881 * We want fsync() to work on POHMELFS.882882 */883883-static int pohmelfs_fsync(struct file *file, struct dentry *dentry, int datasync)883883+static int pohmelfs_fsync(struct file *file, int datasync)884884{885885 struct inode *inode = file->f_mapping->host;886886 struct writeback_control wbc = {
+1-1
drivers/usb/gadget/printer.c
···794794}795795796796static int797797-printer_fsync(struct file *fd, struct dentry *dentry, int datasync)797797+printer_fsync(struct file *fd, int datasync)798798{799799 struct printer_dev *dev = fd->private_data;800800 unsigned long flags;
···916916 affs_free_prealloc(inode);917917}918918919919-int affs_file_fsync(struct file *filp, struct dentry *dentry, int datasync)919919+int affs_file_fsync(struct file *filp, int datasync)920920{921921- struct inode * inode = dentry->d_inode;921921+ struct inode *inode = filp->f_mapping->host;922922 int ret, err;923923924924 ret = write_inode_now(inode, 0);
+1-1
fs/afs/internal.h
···740740extern ssize_t afs_file_write(struct kiocb *, const struct iovec *,741741 unsigned long, loff_t);742742extern int afs_writeback_all(struct afs_vnode *);743743-extern int afs_fsync(struct file *, struct dentry *, int);743743+extern int afs_fsync(struct file *, int);744744745745746746/*****************************************************************************/
+2-1
fs/afs/write.c
···701701 * - the return status from this call provides a reliable indication of702702 * whether any write errors occurred for this process.703703 */704704-int afs_fsync(struct file *file, struct dentry *dentry, int datasync)704704+int afs_fsync(struct file *file, int datasync)705705{706706+ struct dentry *dentry = file->f_path.dentry;706707 struct afs_writeback *wb, *xwb;707708 struct afs_vnode *vnode = AFS_FS_I(dentry->d_inode);708709 int ret;
+1-2
fs/bad_inode.c
···9393 return -EIO;9494}95959696-static int bad_file_fsync(struct file *file, struct dentry *dentry,9797- int datasync)9696+static int bad_file_fsync(struct file *file, int datasync)9897{9998 return -EIO;10099}
+1-6
fs/block_dev.c
···358358 return retval;359359}360360361361-/*362362- * Filp is never NULL; the only case when ->fsync() is called with363363- * NULL first argument is nfsd_sync_dir() and that's not a directory.364364- */365365-366366-int blkdev_fsync(struct file *filp, struct dentry *dentry, int datasync)361361+int blkdev_fsync(struct file *filp, int datasync)367362{368363 struct inode *bd_inode = filp->f_mapping->host;369364 struct block_device *bdev = I_BDEV(bd_inode);
···11011101 * important optimization for directories because holding the mutex prevents11021102 * new operations on the dir while we write to disk.11031103 */11041104-int btrfs_sync_file(struct file *file, struct dentry *dentry, int datasync)11041104+int btrfs_sync_file(struct file *file, int datasync)11051105{11061106+ struct dentry *dentry = file->f_path.dentry;11061107 struct inode *inode = dentry->d_inode;11071108 struct btrfs_root *root = BTRFS_I(inode)->root;11081109 int ret = 0;
···11071107 * an fsync() on a dir will wait for any uncommitted directory11081108 * operations to commit.11091109 */11101110-static int ceph_dir_fsync(struct file *file, struct dentry *dentry,11111111- int datasync)11101110+static int ceph_dir_fsync(struct file *file, int datasync)11121111{11131113- struct inode *inode = dentry->d_inode;11121112+ struct inode *inode = file->f_path.dentry->d_inode;11141113 struct ceph_inode_info *ci = ceph_inode(inode);11151114 struct list_head *head = &ci->i_unsafe_dirops;11161115 struct ceph_mds_request *req;
+1-1
fs/ceph/super.h
···811811812812extern void ceph_queue_caps_release(struct inode *inode);813813extern int ceph_write_inode(struct inode *inode, struct writeback_control *wbc);814814-extern int ceph_fsync(struct file *file, struct dentry *dentry, int datasync);814814+extern int ceph_fsync(struct file *file, int datasync);815815extern void ceph_kick_flushing_caps(struct ceph_mds_client *mdsc,816816 struct ceph_mds_session *session);817817extern int ceph_get_cap_mds(struct inode *inode);
···15191519extern void ext4_htree_free_dir_info(struct dir_private_info *p);1520152015211521/* fsync.c */15221522-extern int ext4_sync_file(struct file *, struct dentry *, int);15221522+extern int ext4_sync_file(struct file *, int);1523152315241524/* hash.c */15251525extern int ext4fs_dirhash(const char *name, int len, struct
+4-4
fs/ext4/fsync.c
···7171 * i_mutex lock is held when entering and exiting this function7272 */73737474-int ext4_sync_file(struct file *file, struct dentry *dentry, int datasync)7474+int ext4_sync_file(struct file *file, int datasync)7575{7676- struct inode *inode = dentry->d_inode;7676+ struct inode *inode = file->f_mapping->host;7777 struct ext4_inode_info *ei = EXT4_I(inode);7878 journal_t *journal = EXT4_SB(inode->i_sb)->s_journal;7979 int ret;···81818282 J_ASSERT(ext4_journal_current_handle() == NULL);83838484- trace_ext4_sync_file(file, dentry, datasync);8484+ trace_ext4_sync_file(file, datasync);85858686 if (inode->i_sb->s_flags & MS_RDONLY)8787 return 0;···9191 return ret;92929393 if (!journal) {9494- ret = simple_fsync(file, dentry, datasync);9494+ ret = simple_fsync(file, datasync);9595 if (!ret && !list_empty(&inode->i_dentry))9696 ext4_sync_parent(inode);9797 return ret;
+1-2
fs/fat/fat.h
···309309extern void fat_truncate(struct inode *inode);310310extern int fat_getattr(struct vfsmount *mnt, struct dentry *dentry,311311 struct kstat *stat);312312-extern int fat_file_fsync(struct file *file, struct dentry *dentry,313313- int datasync);312312+extern int fat_file_fsync(struct file *file, int datasync);314313315314/* fat/inode.c */316315extern void fat_attach(struct inode *inode, loff_t i_pos);
+3-3
fs/fat/file.c
···149149 return 0;150150}151151152152-int fat_file_fsync(struct file *filp, struct dentry *dentry, int datasync)152152+int fat_file_fsync(struct file *filp, int datasync)153153{154154- struct inode *inode = dentry->d_inode;154154+ struct inode *inode = filp->f_mapping->host;155155 int res, err;156156157157- res = simple_fsync(filp, dentry, datasync);157157+ res = simple_fsync(filp, datasync);158158 err = sync_mapping_buffers(MSDOS_SB(inode->i_sb)->fat_inode->i_mapping);159159160160 return res ? res : err;
+2-3
fs/fuse/dir.c
···11561156 return 0;11571157}1158115811591159-static int fuse_dir_fsync(struct file *file, struct dentry *de, int datasync)11591159+static int fuse_dir_fsync(struct file *file, int datasync)11601160{11611161- /* nfsd can call this with no file */11621162- return file ? fuse_fsync_common(file, de, datasync, 1) : 0;11611161+ return fuse_fsync_common(file, datasync, 1);11631162}1164116311651164static bool update_mtime(unsigned ivalid)
+4-5
fs/fuse/file.c
···351351 fuse_release_nowrite(inode);352352}353353354354-int fuse_fsync_common(struct file *file, struct dentry *de, int datasync,355355- int isdir)354354+int fuse_fsync_common(struct file *file, int datasync, int isdir)356355{357357- struct inode *inode = de->d_inode;356356+ struct inode *inode = file->f_mapping->host;358357 struct fuse_conn *fc = get_fuse_conn(inode);359358 struct fuse_file *ff = file->private_data;360359 struct fuse_req *req;···402403 return err;403404}404405405405-static int fuse_fsync(struct file *file, struct dentry *de, int datasync)406406+static int fuse_fsync(struct file *file, int datasync)406407{407407- return fuse_fsync_common(file, de, datasync, 0);408408+ return fuse_fsync_common(file, datasync, 0);408409}409410410411void fuse_read_fill(struct fuse_req *req, struct file *file, loff_t pos,
+1-2
fs/fuse/fuse_i.h
···568568/**569569 * Send FSYNC or FSYNCDIR request570570 */571571-int fuse_fsync_common(struct file *file, struct dentry *de, int datasync,572572- int isdir);571571+int fuse_fsync_common(struct file *file, int datasync, int isdir);573572574573/**575574 * Notify poll wakeup
+2-2
fs/gfs2/file.c
···554554 * Returns: errno555555 */556556557557-static int gfs2_fsync(struct file *file, struct dentry *dentry, int datasync)557557+static int gfs2_fsync(struct file *file, int datasync)558558{559559- struct inode *inode = dentry->d_inode;559559+ struct inode *inode = file->f_mapping->host;560560 int sync_state = inode->i_state & (I_DIRTY_SYNC|I_DIRTY_DATASYNC);561561 int ret = 0;562562
···587587 return err;588588}589589590590-static int hppfs_fsync(struct file *file, struct dentry *dentry, int datasync)590590+static int hppfs_fsync(struct file *file, int datasync)591591{592592 return 0;593593}
+2-2
fs/jffs2/file.c
···2626 struct page **pagep, void **fsdata);2727static int jffs2_readpage (struct file *filp, struct page *pg);28282929-int jffs2_fsync(struct file *filp, struct dentry *dentry, int datasync)2929+int jffs2_fsync(struct file *filp, int datasync)3030{3131- struct inode *inode = dentry->d_inode;3131+ struct inode *inode = filp->f_mapping->host;3232 struct jffs2_sb_info *c = JFFS2_SB_INFO(inode->i_sb);33333434 /* Trigger GC to flush any pending writes for this inode */
···2222#include <linux/ncp_fs.h>2323#include "ncplib_kernel.h"24242525-static int ncp_fsync(struct file *file, struct dentry *dentry, int datasync)2525+static int ncp_fsync(struct file *file, int datasync)2626{2727 return 0;2828}
+4-2
fs/nfs/dir.c
···5353static int nfs_mknod(struct inode *, struct dentry *, int, dev_t);5454static int nfs_rename(struct inode *, struct dentry *,5555 struct inode *, struct dentry *);5656-static int nfs_fsync_dir(struct file *, struct dentry *, int);5656+static int nfs_fsync_dir(struct file *, int);5757static loff_t nfs_llseek_dir(struct file *, loff_t, int);58585959const struct file_operations nfs_dir_operations = {···641641 * All directory operations under NFS are synchronous, so fsync()642642 * is a dummy operation.643643 */644644-static int nfs_fsync_dir(struct file *filp, struct dentry *dentry, int datasync)644644+static int nfs_fsync_dir(struct file *filp, int datasync)645645{646646+ struct dentry *dentry = filp->f_path.dentry;647647+646648 dfprintk(FILE, "NFS: fsync dir(%s/%s) datasync %d\n",647649 dentry->d_parent->d_name.name, dentry->d_name.name,648650 datasync);
+3-2
fs/nfs/file.c
···5353static ssize_t nfs_file_write(struct kiocb *, const struct iovec *iov,5454 unsigned long nr_segs, loff_t pos);5555static int nfs_file_flush(struct file *, fl_owner_t id);5656-static int nfs_file_fsync(struct file *, struct dentry *dentry, int datasync);5656+static int nfs_file_fsync(struct file *, int datasync);5757static int nfs_check_flags(int flags);5858static int nfs_lock(struct file *filp, int cmd, struct file_lock *fl);5959static int nfs_flock(struct file *filp, int cmd, struct file_lock *fl);···322322 * whether any write errors occurred for this process.323323 */324324static int325325-nfs_file_fsync(struct file *file, struct dentry *dentry, int datasync)325325+nfs_file_fsync(struct file *file, int datasync)326326{327327+ struct dentry *dentry = file->f_path.dentry;327328 struct nfs_open_context *ctx = nfs_file_open_context(file);328329 struct inode *inode = dentry->d_inode;329330
+2-2
fs/nilfs2/file.c
···2727#include "nilfs.h"2828#include "segment.h"29293030-int nilfs_sync_file(struct file *file, struct dentry *dentry, int datasync)3030+int nilfs_sync_file(struct file *file, int datasync)3131{3232 /*3333 * Called from fsync() system call···3737 * This function should be implemented when the writeback function3838 * will be implemented.3939 */4040- struct inode *inode = dentry->d_inode;4040+ struct inode *inode = file->f_mapping->host;4141 int err;42424343 if (!nilfs_inode_dirty(inode))
···15271527 * this problem for now. We do write the $BITMAP attribute if it is present15281528 * which is the important one for a directory so things are not too bad.15291529 */15301530-static int ntfs_dir_fsync(struct file *filp, struct dentry *dentry,15311531- int datasync)15301530+static int ntfs_dir_fsync(struct file *filp, int datasync)15321531{15331533- struct inode *bmp_vi, *vi = dentry->d_inode;15321532+ struct inode *bmp_vi, *vi = filp->f_mapping->host;15341533 int err, ret;15351534 ntfs_attr na;15361535
+2-7
fs/ntfs/file.c
···21332133/**21342134 * ntfs_file_fsync - sync a file to disk21352135 * @filp: file to be synced21362136- * @dentry: dentry describing the file to sync21372136 * @datasync: if non-zero only flush user data and not metadata21382137 *21392138 * Data integrity sync of a file to disk. Used for fsync, fdatasync, and msync···21482149 * Also, if @datasync is true, we do not wait on the inode to be written out21492150 * but we always wait on the page cache pages to be written out.21502151 *21512151- * Note: In the past @filp could be NULL so we ignore it as we don't need it21522152- * anyway.21532153- *21542152 * Locking: Caller must hold i_mutex on the inode.21552153 *21562154 * TODO: We should probably also write all attribute/index inodes associated21572155 * with this inode but since we have no simple way of getting to them we ignore21582156 * this problem for now.21592157 */21602160-static int ntfs_file_fsync(struct file *filp, struct dentry *dentry,21612161- int datasync)21582158+static int ntfs_file_fsync(struct file *filp, int datasync)21622159{21632163- struct inode *vi = dentry->d_inode;21602160+ struct inode *vi = filp->f_mapping->host;21642161 int err, ret = 0;2165216221662163 ntfs_debug("Entering for inode 0x%lx.", vi->i_ino);
···1414extern const struct reiserfs_key MIN_KEY;15151616static int reiserfs_readdir(struct file *, void *, filldir_t);1717-static int reiserfs_dir_fsync(struct file *filp, struct dentry *dentry,1818- int datasync);1717+static int reiserfs_dir_fsync(struct file *filp, int datasync);19182019const struct file_operations reiserfs_dir_operations = {2120 .llseek = generic_file_llseek,···2728#endif2829};29303030-static int reiserfs_dir_fsync(struct file *filp, struct dentry *dentry,3131- int datasync)3131+static int reiserfs_dir_fsync(struct file *filp, int datasync)3232{3333- struct inode *inode = dentry->d_inode;3333+ struct inode *inode = filp->f_mapping->host;3434 int err;3535 reiserfs_write_lock(inode->i_sb);3636 err = reiserfs_commit_for_inode(inode);
+2-3
fs/reiserfs/file.c
···134134 * be removed...135135 */136136137137-static int reiserfs_sync_file(struct file *filp,138138- struct dentry *dentry, int datasync)137137+static int reiserfs_sync_file(struct file *filp, int datasync)139138{140140- struct inode *inode = dentry->d_inode;139139+ struct inode *inode = filp->f_mapping->host;141140 int err;142141 int barrier_done;143142
+2-1
fs/smbfs/file.c
···2828#include "proto.h"29293030static int3131-smb_fsync(struct file *file, struct dentry * dentry, int datasync)3131+smb_fsync(struct file *file, int datasync)3232{3333+ struct dentry *dentry = file->f_path.dentry;3334 struct smb_sb_info *server = server_from_dentry(dentry);3435 int result;3536
+3-5
fs/sync.c
···130130131131/*132132 * Generic function to fsync a file.133133- *134134- * filp may be NULL if called via the msync of a vma.135133 */136136-int file_fsync(struct file *filp, struct dentry *dentry, int datasync)134134+int file_fsync(struct file *filp, int datasync)137135{138138- struct inode * inode = dentry->d_inode;136136+ struct inode *inode = filp->f_mapping->host;139137 struct super_block * sb;140138 int ret, err;141139···181183 * livelocks in fsync_buffers_list().182184 */183185 mutex_lock(&mapping->host->i_mutex);184184- err = file->f_op->fsync(file, file->f_path.dentry, datasync);186186+ err = file->f_op->fsync(file, datasync);185187 if (!ret)186188 ret = err;187189 mutex_unlock(&mapping->host->i_mutex);