Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8018ab05 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Al Viro
Browse files

sanitize vfs_fsync calling conventions



Now that the last user passing a NULL file pointer is gone we can remove
the redundant dentry argument and associated hacks inside vfs_fsynmc_range.

The next step will be removig the dentry argument from ->fsync, but given
the luck with the last round of method prototype changes I'd rather
defer this until after the main merge window.

Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent e970a573
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -485,7 +485,7 @@ static int do_bio_filebacked(struct loop_device *lo, struct bio *bio)
				goto out;
				goto out;
			}
			}


			ret = vfs_fsync(file, file->f_path.dentry, 0);
			ret = vfs_fsync(file, 0);
			if (unlikely(ret)) {
			if (unlikely(ret)) {
				ret = -EIO;
				ret = -EIO;
				goto out;
				goto out;
@@ -495,7 +495,7 @@ static int do_bio_filebacked(struct loop_device *lo, struct bio *bio)
		ret = lo_send(lo, bio, pos);
		ret = lo_send(lo, bio, pos);


		if (barrier && !ret) {
		if (barrier && !ret) {
			ret = vfs_fsync(file, file->f_path.dentry, 0);
			ret = vfs_fsync(file, 0);
			if (unlikely(ret))
			if (unlikely(ret))
				ret = -EIO;
				ret = -EIO;
		}
		}
+1 −1
Original line number Original line Diff line number Diff line
@@ -1692,7 +1692,7 @@ int bitmap_create(mddev_t *mddev)
		 * and bypass the page cache, we must sync the file
		 * and bypass the page cache, we must sync the file
		 * first.
		 * first.
		 */
		 */
		vfs_fsync(file, file->f_dentry, 1);
		vfs_fsync(file, 1);
	}
	}
	/* read superblock from bitmap file (this sets mddev->bitmap_info.chunksize) */
	/* read superblock from bitmap file (this sets mddev->bitmap_info.chunksize) */
	if (!mddev->bitmap_info.external)
	if (!mddev->bitmap_info.external)
+1 −1
Original line number Original line Diff line number Diff line
@@ -654,7 +654,7 @@ static int fsg_lun_fsync_sub(struct fsg_lun *curlun)


	if (curlun->ro || !filp)
	if (curlun->ro || !filp)
		return 0;
		return 0;
	return vfs_fsync(filp, filp->f_path.dentry, 1);
	return vfs_fsync(filp, 1);
}
}


static void store_cdrom_address(u8 *dest, int msf, u32 addr)
static void store_cdrom_address(u8 *dest, int msf, u32 addr)
+1 −2
Original line number Original line Diff line number Diff line
@@ -844,8 +844,7 @@ static ssize_t ceph_aio_write(struct kiocb *iocb, const struct iovec *iov,
		if ((ret >= 0 || ret == -EIOCBQUEUED) &&
		if ((ret >= 0 || ret == -EIOCBQUEUED) &&
		    ((file->f_flags & O_SYNC) || IS_SYNC(file->f_mapping->host)
		    ((file->f_flags & O_SYNC) || IS_SYNC(file->f_mapping->host)
		     || ceph_osdmap_flag(osdc->osdmap, CEPH_OSDMAP_NEARFULL))) {
		     || ceph_osdmap_flag(osdc->osdmap, CEPH_OSDMAP_NEARFULL))) {
			err = vfs_fsync_range(file, file->f_path.dentry,
			err = vfs_fsync_range(file, pos, pos + ret - 1, 1);
					      pos, pos + ret - 1, 1);
			if (err < 0)
			if (err < 0)
				ret = err;
				ret = err;
		}
		}
+1 −1
Original line number Original line Diff line number Diff line
@@ -217,7 +217,7 @@ int coda_fsync(struct file *coda_file, struct dentry *coda_dentry, int datasync)
	BUG_ON(!cfi || cfi->cfi_magic != CODA_MAGIC);
	BUG_ON(!cfi || cfi->cfi_magic != CODA_MAGIC);
	host_file = cfi->cfi_container;
	host_file = cfi->cfi_container;


	err = vfs_fsync(host_file, host_file->f_path.dentry, datasync);
	err = vfs_fsync(host_file, datasync);
	if ( !err && !datasync ) {
	if ( !err && !datasync ) {
		lock_kernel();
		lock_kernel();
		err = venus_fsync(coda_inode->i_sb, coda_i2f(coda_inode));
		err = venus_fsync(coda_inode->i_sb, coda_i2f(coda_inode));
Loading