Skip to content

Commit

Permalink
drop unused dentry argument to ->fsync
Browse files Browse the repository at this point in the history
Signed-off-by: Christoph Hellwig <[email protected]>
Signed-off-by: Al Viro <[email protected]>
  • Loading branch information
Christoph Hellwig authored and Al Viro committed May 28, 2010
1 parent cc967be commit 7ea8085
Show file tree
Hide file tree
Showing 69 changed files with 129 additions and 157 deletions.
2 changes: 1 addition & 1 deletion Documentation/filesystems/Locking
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ prototypes:
int (*open) (struct inode *, struct file *);
int (*flush) (struct file *);
int (*release) (struct inode *, struct file *);
int (*fsync) (struct file *, struct dentry *, int datasync);
int (*fsync) (struct file *, int datasync);
int (*aio_fsync) (struct kiocb *, int datasync);
int (*fasync) (int, struct file *, int);
int (*lock) (struct file *, int, struct file_lock *);
Expand Down
2 changes: 1 addition & 1 deletion Documentation/filesystems/vfs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -729,7 +729,7 @@ struct file_operations {
int (*open) (struct inode *, struct file *);
int (*flush) (struct file *);
int (*release) (struct inode *, struct file *);
int (*fsync) (struct file *, struct dentry *, int datasync);
int (*fsync) (struct file *, int datasync);
int (*aio_fsync) (struct kiocb *, int datasync);
int (*fasync) (int, struct file *, int);
int (*lock) (struct file *, int, struct file_lock *);
Expand Down
3 changes: 1 addition & 2 deletions arch/powerpc/platforms/cell/spufs/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -1849,8 +1849,7 @@ static int spufs_mfc_flush(struct file *file, fl_owner_t id)
return ret;
}

static int spufs_mfc_fsync(struct file *file, struct dentry *dentry,
int datasync)
static int spufs_mfc_fsync(struct file *file, int datasync)
{
return spufs_mfc_flush(file, NULL);
}
Expand Down
3 changes: 1 addition & 2 deletions drivers/char/ps3flash.c
Original file line number Diff line number Diff line change
Expand Up @@ -305,8 +305,7 @@ static int ps3flash_flush(struct file *file, fl_owner_t id)
return ps3flash_writeback(ps3flash_dev);
}

static int ps3flash_fsync(struct file *file, struct dentry *dentry,
int datasync)
static int ps3flash_fsync(struct file *file, int datasync)
{
return ps3flash_writeback(ps3flash_dev);
}
Expand Down
3 changes: 1 addition & 2 deletions drivers/mtd/ubi/cdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,7 @@ static loff_t vol_cdev_llseek(struct file *file, loff_t offset, int origin)
return new_offset;
}

static int vol_cdev_fsync(struct file *file, struct dentry *dentry,
int datasync)
static int vol_cdev_fsync(struct file *file, int datasync)
{
struct ubi_volume_desc *desc = file->private_data;
struct ubi_device *ubi = desc->vol->ubi;
Expand Down
2 changes: 1 addition & 1 deletion drivers/staging/pohmelfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -880,7 +880,7 @@ static struct inode *pohmelfs_alloc_inode(struct super_block *sb)
/*
* We want fsync() to work on POHMELFS.
*/
static int pohmelfs_fsync(struct file *file, struct dentry *dentry, int datasync)
static int pohmelfs_fsync(struct file *file, int datasync)
{
struct inode *inode = file->f_mapping->host;
struct writeback_control wbc = {
Expand Down
2 changes: 1 addition & 1 deletion drivers/usb/gadget/printer.c
Original file line number Diff line number Diff line change
Expand Up @@ -794,7 +794,7 @@ printer_write(struct file *fd, const char __user *buf, size_t len, loff_t *ptr)
}

static int
printer_fsync(struct file *fd, struct dentry *dentry, int datasync)
printer_fsync(struct file *fd, int datasync)
{
struct printer_dev *dev = fd->private_data;
unsigned long flags;
Expand Down
2 changes: 1 addition & 1 deletion drivers/video/fb_defio.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ static int fb_deferred_io_fault(struct vm_area_struct *vma,
return 0;
}

int fb_deferred_io_fsync(struct file *file, struct dentry *dentry, int datasync)
int fb_deferred_io_fsync(struct file *file, int datasync)
{
struct fb_info *info = file->private_data;

Expand Down
6 changes: 2 additions & 4 deletions fs/9p/vfs_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -257,15 +257,13 @@ v9fs_file_write(struct file *filp, const char __user * data,
return total;
}

static int v9fs_file_fsync(struct file *filp, struct dentry *dentry,
int datasync)
static int v9fs_file_fsync(struct file *filp, int datasync)
{
struct p9_fid *fid;
struct p9_wstat wstat;
int retval;

P9_DPRINTK(P9_DEBUG_VFS, "filp %p dentry %p datasync %x\n", filp,
dentry, datasync);
P9_DPRINTK(P9_DEBUG_VFS, "filp %p datasync %x\n", filp, datasync);

fid = filp->private_data;
v9fs_blank_wstat(&wstat);
Expand Down
2 changes: 1 addition & 1 deletion fs/affs/affs.h
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ extern int affs_add_entry(struct inode *dir, struct inode *inode, struct dent

void affs_free_prealloc(struct inode *inode);
extern void affs_truncate(struct inode *);
int affs_file_fsync(struct file *, struct dentry *, int);
int affs_file_fsync(struct file *, int);

/* dir.c */

Expand Down
4 changes: 2 additions & 2 deletions fs/affs/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -916,9 +916,9 @@ affs_truncate(struct inode *inode)
affs_free_prealloc(inode);
}

int affs_file_fsync(struct file *filp, struct dentry *dentry, int datasync)
int affs_file_fsync(struct file *filp, int datasync)
{
struct inode * inode = dentry->d_inode;
struct inode *inode = filp->f_mapping->host;
int ret, err;

ret = write_inode_now(inode, 0);
Expand Down
2 changes: 1 addition & 1 deletion fs/afs/internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -740,7 +740,7 @@ extern void afs_pages_written_back(struct afs_vnode *, struct afs_call *);
extern ssize_t afs_file_write(struct kiocb *, const struct iovec *,
unsigned long, loff_t);
extern int afs_writeback_all(struct afs_vnode *);
extern int afs_fsync(struct file *, struct dentry *, int);
extern int afs_fsync(struct file *, int);


/*****************************************************************************/
Expand Down
3 changes: 2 additions & 1 deletion fs/afs/write.c
Original file line number Diff line number Diff line change
Expand Up @@ -701,8 +701,9 @@ int afs_writeback_all(struct afs_vnode *vnode)
* - the return status from this call provides a reliable indication of
* whether any write errors occurred for this process.
*/
int afs_fsync(struct file *file, struct dentry *dentry, int datasync)
int afs_fsync(struct file *file, int datasync)
{
struct dentry *dentry = file->f_path.dentry;
struct afs_writeback *wb, *xwb;
struct afs_vnode *vnode = AFS_FS_I(dentry->d_inode);
int ret;
Expand Down
3 changes: 1 addition & 2 deletions fs/bad_inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,7 @@ static int bad_file_release(struct inode *inode, struct file *filp)
return -EIO;
}

static int bad_file_fsync(struct file *file, struct dentry *dentry,
int datasync)
static int bad_file_fsync(struct file *file, int datasync)
{
return -EIO;
}
Expand Down
7 changes: 1 addition & 6 deletions fs/block_dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -358,12 +358,7 @@ static loff_t block_llseek(struct file *file, loff_t offset, int origin)
return retval;
}

/*
* Filp is never NULL; the only case when ->fsync() is called with
* NULL first argument is nfsd_sync_dir() and that's not a directory.
*/

int blkdev_fsync(struct file *filp, struct dentry *dentry, int datasync)
int blkdev_fsync(struct file *filp, int datasync)
{
struct inode *bd_inode = filp->f_mapping->host;
struct block_device *bdev = I_BDEV(bd_inode);
Expand Down
2 changes: 1 addition & 1 deletion fs/btrfs/ctree.h
Original file line number Diff line number Diff line change
Expand Up @@ -2434,7 +2434,7 @@ void btrfs_update_iflags(struct inode *inode);
void btrfs_inherit_iflags(struct inode *inode, struct inode *dir);

/* file.c */
int btrfs_sync_file(struct file *file, struct dentry *dentry, int datasync);
int btrfs_sync_file(struct file *file, int datasync);
int btrfs_drop_extent_cache(struct inode *inode, u64 start, u64 end,
int skip_pinned);
int btrfs_check_file(struct btrfs_root *root, struct inode *inode);
Expand Down
3 changes: 2 additions & 1 deletion fs/btrfs/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -1101,8 +1101,9 @@ int btrfs_release_file(struct inode *inode, struct file *filp)
* important optimization for directories because holding the mutex prevents
* new operations on the dir while we write to disk.
*/
int btrfs_sync_file(struct file *file, struct dentry *dentry, int datasync)
int btrfs_sync_file(struct file *file, int datasync)
{
struct dentry *dentry = file->f_path.dentry;
struct inode *inode = dentry->d_inode;
struct btrfs_root *root = BTRFS_I(inode)->root;
int ret = 0;
Expand Down
4 changes: 2 additions & 2 deletions fs/ceph/caps.c
Original file line number Diff line number Diff line change
Expand Up @@ -1776,9 +1776,9 @@ static void sync_write_wait(struct inode *inode)
spin_unlock(&ci->i_unsafe_lock);
}

int ceph_fsync(struct file *file, struct dentry *dentry, int datasync)
int ceph_fsync(struct file *file, int datasync)
{
struct inode *inode = dentry->d_inode;
struct inode *inode = file->f_mapping->host;
struct ceph_inode_info *ci = ceph_inode(inode);
unsigned flush_tid;
int ret;
Expand Down
5 changes: 2 additions & 3 deletions fs/ceph/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -1107,10 +1107,9 @@ static ssize_t ceph_read_dir(struct file *file, char __user *buf, size_t size,
* an fsync() on a dir will wait for any uncommitted directory
* operations to commit.
*/
static int ceph_dir_fsync(struct file *file, struct dentry *dentry,
int datasync)
static int ceph_dir_fsync(struct file *file, int datasync)
{
struct inode *inode = dentry->d_inode;
struct inode *inode = file->f_path.dentry->d_inode;
struct ceph_inode_info *ci = ceph_inode(inode);
struct list_head *head = &ci->i_unsafe_dirops;
struct ceph_mds_request *req;
Expand Down
2 changes: 1 addition & 1 deletion fs/ceph/super.h
Original file line number Diff line number Diff line change
Expand Up @@ -811,7 +811,7 @@ extern void ceph_put_cap(struct ceph_cap *cap);

extern void ceph_queue_caps_release(struct inode *inode);
extern int ceph_write_inode(struct inode *inode, struct writeback_control *wbc);
extern int ceph_fsync(struct file *file, struct dentry *dentry, int datasync);
extern int ceph_fsync(struct file *file, int datasync);
extern void ceph_kick_flushing_caps(struct ceph_mds_client *mdsc,
struct ceph_mds_session *session);
extern int ceph_get_cap_mds(struct inode *inode);
Expand Down
2 changes: 1 addition & 1 deletion fs/cifs/cifsfs.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ extern ssize_t cifs_user_read(struct file *file, char __user *read_data,
extern ssize_t cifs_user_write(struct file *file, const char __user *write_data,
size_t write_size, loff_t *poffset);
extern int cifs_lock(struct file *, int, struct file_lock *);
extern int cifs_fsync(struct file *, struct dentry *, int);
extern int cifs_fsync(struct file *, int);
extern int cifs_flush(struct file *, fl_owner_t id);
extern int cifs_file_mmap(struct file * , struct vm_area_struct *);
extern const struct file_operations cifs_dir_ops;
Expand Down
4 changes: 2 additions & 2 deletions fs/cifs/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -1676,7 +1676,7 @@ static int cifs_write_end(struct file *file, struct address_space *mapping,
return rc;
}

int cifs_fsync(struct file *file, struct dentry *dentry, int datasync)
int cifs_fsync(struct file *file, int datasync)
{
int xid;
int rc = 0;
Expand All @@ -1688,7 +1688,7 @@ int cifs_fsync(struct file *file, struct dentry *dentry, int datasync)
xid = GetXid();

cFYI(1, "Sync file - name: %s datasync: 0x%x",
dentry->d_name.name, datasync);
file->f_path.dentry->d_name.name, datasync);

rc = filemap_write_and_wait(inode->i_mapping);
if (rc == 0) {
Expand Down
3 changes: 1 addition & 2 deletions fs/coda/coda_int.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ extern int coda_fake_statfs;

void coda_destroy_inodecache(void);
int coda_init_inodecache(void);
int coda_fsync(struct file *coda_file, struct dentry *coda_dentry,
int datasync);
int coda_fsync(struct file *coda_file, int datasync);
void coda_sysctl_init(void);
void coda_sysctl_clean(void);

Expand Down
4 changes: 2 additions & 2 deletions fs/coda/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -202,10 +202,10 @@ int coda_release(struct inode *coda_inode, struct file *coda_file)
return 0;
}

int coda_fsync(struct file *coda_file, struct dentry *coda_dentry, int datasync)
int coda_fsync(struct file *coda_file, int datasync)
{
struct file *host_file;
struct inode *coda_inode = coda_dentry->d_inode;
struct inode *coda_inode = coda_file->f_path.dentry->d_inode;
struct coda_file_info *cfi;
int err = 0;

Expand Down
2 changes: 1 addition & 1 deletion fs/ecryptfs/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ static int ecryptfs_release(struct inode *inode, struct file *file)
}

static int
ecryptfs_fsync(struct file *file, struct dentry *dentry, int datasync)
ecryptfs_fsync(struct file *file, int datasync)
{
return vfs_fsync(ecryptfs_file_to_lower(file), datasync);
}
Expand Down
7 changes: 3 additions & 4 deletions fs/exofs/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,11 @@ static int exofs_release_file(struct inode *inode, struct file *filp)
return 0;
}

static int exofs_file_fsync(struct file *filp, struct dentry *dentry,
int datasync)
static int exofs_file_fsync(struct file *filp, int datasync)
{
int ret;
struct address_space *mapping = filp->f_mapping;
struct inode *inode = dentry->d_inode;
struct inode *inode = mapping->host;
struct super_block *sb;

ret = filemap_write_and_wait(mapping);
Expand All @@ -66,7 +65,7 @@ static int exofs_file_fsync(struct file *filp, struct dentry *dentry,

static int exofs_flush(struct file *file, fl_owner_t id)
{
exofs_file_fsync(file, file->f_path.dentry, 1);
exofs_file_fsync(file, 1);
/* TODO: Flush the OSD target */
return 0;
}
Expand Down
2 changes: 1 addition & 1 deletion fs/ext2/ext2.h
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ extern void ext2_write_super (struct super_block *);
extern const struct file_operations ext2_dir_operations;

/* file.c */
extern int ext2_fsync(struct file *file, struct dentry *dentry, int datasync);
extern int ext2_fsync(struct file *file, int datasync);
extern const struct inode_operations ext2_file_inode_operations;
extern const struct file_operations ext2_file_operations;
extern const struct file_operations ext2_xip_file_operations;
Expand Down
6 changes: 3 additions & 3 deletions fs/ext2/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@ static int ext2_release_file (struct inode * inode, struct file * filp)
return 0;
}

int ext2_fsync(struct file *file, struct dentry *dentry, int datasync)
int ext2_fsync(struct file *file, int datasync)
{
int ret;
struct super_block *sb = dentry->d_inode->i_sb;
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, dentry, datasync);
ret = simple_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
4 changes: 2 additions & 2 deletions fs/ext3/fsync.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@
* inode to disk.
*/

int ext3_sync_file(struct file * file, struct dentry *dentry, int datasync)
int ext3_sync_file(struct file *file, int datasync)
{
struct inode *inode = dentry->d_inode;
struct inode *inode = file->f_mapping->host;
struct ext3_inode_info *ei = EXT3_I(inode);
journal_t *journal = EXT3_SB(inode->i_sb)->s_journal;
int ret, needs_barrier = 0;
Expand Down
2 changes: 1 addition & 1 deletion fs/ext4/ext4.h
Original file line number Diff line number Diff line change
Expand Up @@ -1519,7 +1519,7 @@ extern int ext4_htree_store_dirent(struct file *dir_file, __u32 hash,
extern void ext4_htree_free_dir_info(struct dir_private_info *p);

/* fsync.c */
extern int ext4_sync_file(struct file *, struct dentry *, int);
extern int ext4_sync_file(struct file *, int);

/* hash.c */
extern int ext4fs_dirhash(const char *name, int len, struct
Expand Down
8 changes: 4 additions & 4 deletions fs/ext4/fsync.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,17 +71,17 @@ static void ext4_sync_parent(struct inode *inode)
* i_mutex lock is held when entering and exiting this function
*/

int ext4_sync_file(struct file *file, struct dentry *dentry, int datasync)
int ext4_sync_file(struct file *file, int datasync)
{
struct inode *inode = dentry->d_inode;
struct inode *inode = file->f_mapping->host;
struct ext4_inode_info *ei = EXT4_I(inode);
journal_t *journal = EXT4_SB(inode->i_sb)->s_journal;
int ret;
tid_t commit_tid;

J_ASSERT(ext4_journal_current_handle() == NULL);

trace_ext4_sync_file(file, dentry, datasync);
trace_ext4_sync_file(file, datasync);

if (inode->i_sb->s_flags & MS_RDONLY)
return 0;
Expand All @@ -91,7 +91,7 @@ int ext4_sync_file(struct file *file, struct dentry *dentry, int datasync)
return ret;

if (!journal) {
ret = simple_fsync(file, dentry, datasync);
ret = simple_fsync(file, datasync);
if (!ret && !list_empty(&inode->i_dentry))
ext4_sync_parent(inode);
return ret;
Expand Down
3 changes: 1 addition & 2 deletions fs/fat/fat.h
Original file line number Diff line number Diff line change
Expand Up @@ -309,8 +309,7 @@ extern int fat_setattr(struct dentry * dentry, struct iattr * attr);
extern void fat_truncate(struct inode *inode);
extern int fat_getattr(struct vfsmount *mnt, struct dentry *dentry,
struct kstat *stat);
extern int fat_file_fsync(struct file *file, struct dentry *dentry,
int datasync);
extern int fat_file_fsync(struct file *file, int datasync);

/* fat/inode.c */
extern void fat_attach(struct inode *inode, loff_t i_pos);
Expand Down
6 changes: 3 additions & 3 deletions fs/fat/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -149,12 +149,12 @@ static int fat_file_release(struct inode *inode, struct file *filp)
return 0;
}

int fat_file_fsync(struct file *filp, struct dentry *dentry, int datasync)
int fat_file_fsync(struct file *filp, int datasync)
{
struct inode *inode = dentry->d_inode;
struct inode *inode = filp->f_mapping->host;
int res, err;

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

return res ? res : err;
Expand Down
Loading

0 comments on commit 7ea8085

Please sign in to comment.