Пример #1
0
/* hpux statfs */
asmlinkage long hpux_statfs(const char __user *path,
						struct hpux_statfs __user *buf)
{
	struct nameidata nd;
	int error;

	error = user_path_walk(path, &nd);
	if (!error) {
		struct hpux_statfs tmp;
		error = vfs_statfs_hpux(nd.dentry->d_inode->i_sb, &tmp);
		if (!error && copy_to_user(buf, &tmp, sizeof(tmp)))
			error = -EFAULT;
		path_release(&nd);
	}
	return error;
}
Пример #2
0
/* hpux statfs */
asmlinkage long hpux_statfs(const char __user *pathname,
						struct hpux_statfs __user *buf)
{
	struct path path;
	int error;

	error = user_path(pathname, &path);
	if (!error) {
		struct hpux_statfs tmp;
		error = vfs_statfs_hpux(path.dentry, &tmp);
		if (!error && copy_to_user(buf, &tmp, sizeof(tmp)))
			error = -EFAULT;
		path_put(&path);
	}
	return error;
}
Пример #3
0
asmlinkage long hpux_fstatfs(unsigned int fd, struct hpux_statfs __user * buf)
{
	struct file *file;
	struct hpux_statfs tmp;
	int error;

	error = -EBADF;
	file = fget(fd);
	if (!file)
		goto out;
	error = vfs_statfs_hpux(file->f_dentry->d_inode->i_sb, &tmp);
	if (!error && copy_to_user(buf, &tmp, sizeof(tmp)))
		error = -EFAULT;
	fput(file);
 out:
	return error;
}