/* Truncate a file to the specified size - all we have to do is set the size attribute. We make sure the object exists first.  */
void exofs_truncate(struct inode *inode)
/* Truncate a file to the specified size - all we have to do is set the size attribute. We make sure the object exists first.  */
void exofs_truncate(struct inode *inode)
{
	struct exofs_i_info *oi = exofs_i(inode);
	int ret;
	if (!(S_ISREG(inode->i_mode) || S_ISDIR(inode->i_mode)
	     || S_ISLNK(inode->i_mode)))
		return;
	if (exofs_inode_is_fast_symlink(inode))
		return;
	if (IS_APPEND(inode) || IS_IMMUTABLE(inode))
		return;
	if (unlikely(wait_obj_created(oi)))
		goto fail;
	ret = _do_truncate(inode);
	if (ret)
		goto fail;
out:
	mark_inode_dirty(inode);
	return;
fail:
	make_bad_inode(inode);
	goto out;
}