/* filp may be NULL if called via the msync of a vma.  */
int file_fsync(struct file *filp, struct dentry *dentry, int datasync)
/* filp may be NULL if called via the msync of a vma.  */
int file_fsync(struct file *filp, struct dentry *dentry, int datasync)
{
	struct inode * inode = dentry->d_inode;
	struct super_block * sb;
	int ret, err;
	ret = write_inode_now(inode, 0);
	sb = inode->i_sb;
	if (sb->s_dirt && sb->s_op->write_super)
		sb->s_op->write_super(sb);
	err = sync_blockdev(sb->s_bdev);
	if (!ret)
		ret = err;
	return ret;
}