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

Commit 54917786 authored by Chuck Lever's avatar Chuck Lever Committed by Trond Myklebust
Browse files

NFS: Make nfs_fsync methods consistent



Clean up: Report the same debugging info, count function calls the same,
and use similar function naming in nfs_fsync_dir() and nfs_fsync().

Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
parent cb3997b5
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -629,10 +629,11 @@ static loff_t nfs_llseek_dir(struct file *filp, loff_t offset, int origin)
 */
 */
static int nfs_fsync_dir(struct file *filp, struct dentry *dentry, int datasync)
static int nfs_fsync_dir(struct file *filp, struct dentry *dentry, int datasync)
{
{
	dfprintk(VFS, "NFS: fsync_dir(%s/%s) datasync %d\n",
	dfprintk(VFS, "NFS: fsync dir(%s/%s) datasync %d\n",
			dentry->d_parent->d_name.name, dentry->d_name.name,
			dentry->d_parent->d_name.name, dentry->d_name.name,
			datasync);
			datasync);


	nfs_inc_stats(dentry->d_inode, NFSIOS_VFSFSYNC);
	return 0;
	return 0;
}
}


+7 −5
Original line number Original line Diff line number Diff line
@@ -50,7 +50,7 @@ static ssize_t nfs_file_read(struct kiocb *, const struct iovec *iov,
static ssize_t nfs_file_write(struct kiocb *, const struct iovec *iov,
static ssize_t nfs_file_write(struct kiocb *, const struct iovec *iov,
				unsigned long nr_segs, loff_t pos);
				unsigned long nr_segs, loff_t pos);
static int  nfs_file_flush(struct file *, fl_owner_t id);
static int  nfs_file_flush(struct file *, fl_owner_t id);
static int  nfs_fsync(struct file *, struct dentry *dentry, int datasync);
static int  nfs_file_fsync(struct file *, struct dentry *dentry, int datasync);
static int nfs_check_flags(int flags);
static int nfs_check_flags(int flags);
static int nfs_lock(struct file *filp, int cmd, struct file_lock *fl);
static int nfs_lock(struct file *filp, int cmd, struct file_lock *fl);
static int nfs_flock(struct file *filp, int cmd, struct file_lock *fl);
static int nfs_flock(struct file *filp, int cmd, struct file_lock *fl);
@@ -72,7 +72,7 @@ const struct file_operations nfs_file_operations = {
	.open		= nfs_file_open,
	.open		= nfs_file_open,
	.flush		= nfs_file_flush,
	.flush		= nfs_file_flush,
	.release	= nfs_file_release,
	.release	= nfs_file_release,
	.fsync		= nfs_fsync,
	.fsync		= nfs_file_fsync,
	.lock		= nfs_lock,
	.lock		= nfs_lock,
	.flock		= nfs_flock,
	.flock		= nfs_flock,
	.splice_read	= nfs_file_splice_read,
	.splice_read	= nfs_file_splice_read,
@@ -181,7 +181,7 @@ static loff_t nfs_file_llseek(struct file *filp, loff_t offset, int origin)
}
}


/*
/*
 * Helper for nfs_file_flush() and nfs_fsync()
 * Helper for nfs_file_flush() and nfs_file_fsync()
 *
 *
 * Notice that it clears the NFS_CONTEXT_ERROR_WRITE before synching to
 * Notice that it clears the NFS_CONTEXT_ERROR_WRITE before synching to
 * disk, but it retrieves and clears ctx->error after synching, despite
 * disk, but it retrieves and clears ctx->error after synching, despite
@@ -296,12 +296,14 @@ nfs_file_mmap(struct file * file, struct vm_area_struct * vma)
 * whether any write errors occurred for this process.
 * whether any write errors occurred for this process.
 */
 */
static int
static int
nfs_fsync(struct file *file, struct dentry *dentry, int datasync)
nfs_file_fsync(struct file *file, struct dentry *dentry, int datasync)
{
{
	struct nfs_open_context *ctx = nfs_file_open_context(file);
	struct nfs_open_context *ctx = nfs_file_open_context(file);
	struct inode *inode = dentry->d_inode;
	struct inode *inode = dentry->d_inode;


	dfprintk(VFS, "nfs: fsync(%s/%ld)\n", inode->i_sb->s_id, inode->i_ino);
	dfprintk(VFS, "NFS: fsync file(%s/%s) datasync %d\n",
			dentry->d_parent->d_name.name, dentry->d_name.name,
			datasync);


	nfs_inc_stats(inode, NFSIOS_VFSFSYNC);
	nfs_inc_stats(inode, NFSIOS_VFSFSYNC);
	return nfs_do_fsync(ctx, inode);
	return nfs_do_fsync(ctx, inode);