/* HPUX's utssys() call. It's a collection of miscellaneous functions, alas, so there's no nice way of splitting them up.  */
static int hpux_ustat(dev_t dev, struct hpux_ustat __user *ubuf)
/* HPUX's utssys() call. It's a collection of miscellaneous functions, alas, so there's no nice way of splitting them up.  */
static int hpux_ustat(dev_t dev, struct hpux_ustat __user *ubuf)
{
	struct super_block *s;
	struct hpux_ustat tmp;
	struct kstatfs sbuf;
	int err = -EINVAL;
	s = user_get_super(dev);
	if (s == NULL)
		goto out;
	err = vfs_statfs(s->s_root, &sbuf);
	drop_super(s);
	if (err)
		goto out;
	memset(&tmp,0,sizeof(tmp));
	tmp.f_tfree = (int32_t)sbuf.f_bfree;
	tmp.f_tinode = (u_int32_t)sbuf.f_ffree;
	tmp.f_blksize = (u_int32_t)sbuf.f_bsize;
	err = copy_to_user(ubuf, &tmp, sizeof(tmp)) ? -EFAULT : 0;
out:
	return err;
}