/* As file closes, flush all cached write data for this inode checking for write behind errors.  */
int cifs_flush(struct file *file, fl_owner_t id)
/* As file closes, flush all cached write data for this inode checking for write behind errors.  */
int cifs_flush(struct file *file, fl_owner_t id)
{
	struct inode *inode = file->f_path.dentry->d_inode;
	int rc = 0;
	rc = filemap_fdatawrite(inode->i_mapping);
	if (!rc) {
		rc = CIFS_I(inode)->write_behind_rc;
		CIFS_I(inode)->write_behind_rc = 0;
	}
	cFYI(1, ("Flush inode %p file %p rc %d", inode, file, rc));
	return rc;
}