/* Flush all dirty pages, and check for write errors.  */
static int nfs_file_flush(struct file *, fl_owner_t id)
/* Flush all dirty pages, and check for write errors.  */
static int nfs_file_flush(struct file *, fl_owner_t id)
{
	struct nfs_open_context *ctx = nfs_file_open_context(file);
	struct dentry	*dentry = file->f_path.dentry;
	struct inode	*inode = dentry->d_inode;
	dprintk("NFS: flush(%s/%s)\n",
			dentry->d_parent->d_name.name,
			dentry->d_name.name);
	if ((file->f_mode & FMODE_WRITE) == 0)
		return 0;
	nfs_inc_stats(inode, NFSIOS_VFSFLUSH);
	return nfs_do_fsync(ctx, inode);
}