Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 422e6c4b authored by Linus Torvalds's avatar Linus Torvalds
Browse files
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6: (57 commits)
  tidy the trailing symlinks traversal up
  Turn resolution of trailing symlinks iterative everywhere
  simplify link_path_walk() tail
  Make trailing symlink resolution in path_lookupat() iterative
  update nd->inode in __do_follow_link() instead of after do_follow_link()
  pull handling of one pathname component into a helper
  fs: allow AT_EMPTY_PATH in linkat(), limit that to CAP_DAC_READ_SEARCH
  Allow passing O_PATH descriptors via SCM_RIGHTS datagrams
  readlinkat(), fchownat() and fstatat() with empty relative pathnames
  Allow O_PATH for symlinks
  New kind of open files - "location only".
  ext4: Copy fs UUID to superblock
  ext3: Copy fs UUID to superblock.
  vfs: Export file system uuid via /proc/<pid>/mountinfo
  unistd.h: Add new syscalls numbers to asm-generic
  x86: Add new syscalls for x86_64
  x86: Add new syscalls for x86_32
  fs: Remove i_nlink check from file system link callback
  fs: Don't allow to create hardlink for deleted file
  vfs: Add open by file handle support
  ...
parents c83ce989 574197e0
Loading
Loading
Loading
Loading
+8 −28
Original line number Diff line number Diff line
@@ -230,44 +230,24 @@ linux_to_osf_statfs(struct kstatfs *linux_stat, struct osf_statfs __user *osf_st
	return copy_to_user(osf_stat, &tmp_stat, bufsiz) ? -EFAULT : 0;
}

static int
do_osf_statfs(struct path *path, struct osf_statfs __user *buffer,
	      unsigned long bufsiz)
SYSCALL_DEFINE3(osf_statfs, const char __user *, pathname,
		struct osf_statfs __user *, buffer, unsigned long, bufsiz)
{
	struct kstatfs linux_stat;
	int error = vfs_statfs(path, &linux_stat);
	int error = user_statfs(pathname, &linux_stat);
	if (!error)
		error = linux_to_osf_statfs(&linux_stat, buffer, bufsiz);
	return error;	
}

SYSCALL_DEFINE3(osf_statfs, const char __user *, pathname,
		struct osf_statfs __user *, buffer, unsigned long, bufsiz)
{
	struct path path;
	int retval;

	retval = user_path(pathname, &path);
	if (!retval) {
		retval = do_osf_statfs(&path, buffer, bufsiz);
		path_put(&path);
	}
	return retval;
}

SYSCALL_DEFINE3(osf_fstatfs, unsigned long, fd,
		struct osf_statfs __user *, buffer, unsigned long, bufsiz)
{
	struct file *file;
	int retval;

	retval = -EBADF;
	file = fget(fd);
	if (file) {
		retval = do_osf_statfs(&file->f_path, buffer, bufsiz);
		fput(file);
	}
	return retval;
	struct kstatfs linux_stat;
	int error = fd_statfs(fd, &linux_stat);
	if (!error)
		error = linux_to_osf_statfs(&linux_stat, buffer, bufsiz);
	return error;
}

/*
+22 −43
Original line number Diff line number Diff line
@@ -185,26 +185,21 @@ struct hpux_statfs {
     int16_t f_pad;
};

static int do_statfs_hpux(struct path *path, struct hpux_statfs *buf)
static int do_statfs_hpux(struct kstatfs *st, struct hpux_statfs __user *p)
{
	struct kstatfs st;
	int retval;
	
	retval = vfs_statfs(path, &st);
	if (retval)
		return retval;

	memset(buf, 0, sizeof(*buf));
	buf->f_type = st.f_type;
	buf->f_bsize = st.f_bsize;
	buf->f_blocks = st.f_blocks;
	buf->f_bfree = st.f_bfree;
	buf->f_bavail = st.f_bavail;
	buf->f_files = st.f_files;
	buf->f_ffree = st.f_ffree;
	buf->f_fsid[0] = st.f_fsid.val[0];
	buf->f_fsid[1] = st.f_fsid.val[1];

	struct hpux_statfs buf;
	memset(&buf, 0, sizeof(buf));
	buf.f_type = st->f_type;
	buf.f_bsize = st->f_bsize;
	buf.f_blocks = st->f_blocks;
	buf.f_bfree = st->f_bfree;
	buf.f_bavail = st->f_bavail;
	buf.f_files = st->f_files;
	buf.f_ffree = st->f_ffree;
	buf.f_fsid[0] = st->f_fsid.val[0];
	buf.f_fsid[1] = st->f_fsid.val[1];
	if (copy_to_user(p, &buf, sizeof(buf)))
		return -EFAULT;
	return 0;
}

@@ -212,35 +207,19 @@ static int do_statfs_hpux(struct path *path, struct hpux_statfs *buf)
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 = do_statfs_hpux(&path, &tmp);
		if (!error && copy_to_user(buf, &tmp, sizeof(tmp)))
			error = -EFAULT;
		path_put(&path);
	}
	struct kstatfs st;
	int error = user_statfs(pathname, &st);
	if (!error)
		error = do_statfs_hpux(&st, buf);
	return error;
}

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 = do_statfs_hpux(&file->f_path, &tmp);
	if (!error && copy_to_user(buf, &tmp, sizeof(tmp)))
		error = -EFAULT;
	fput(file);
 out:
	struct kstatfs st;
	int error = fd_statfs(fd, &st);
	if (!error)
		error = do_statfs_hpux(&st, buf);
	return error;
}

+1 −1
Original line number Diff line number Diff line
@@ -70,7 +70,7 @@ static long do_spu_create(const char __user *pathname, unsigned int flags,
	if (!IS_ERR(tmp)) {
		struct nameidata nd;

		ret = path_lookup(tmp, LOOKUP_PARENT, &nd);
		ret = kern_path_parent(tmp, &nd);
		if (!ret) {
			nd.flags |= LOOKUP_OPEN | LOOKUP_CREATE;
			ret = spufs_create(&nd, flags, mode, neighbor);
+2 −19
Original line number Diff line number Diff line
@@ -124,35 +124,18 @@ void mconsole_log(struct mc_request *req)
#if 0
void mconsole_proc(struct mc_request *req)
{
	struct nameidata nd;
	struct vfsmount *mnt = current->nsproxy->pid_ns->proc_mnt;
	struct file *file;
	int n, err;
	int n;
	char *ptr = req->request.data, *buf;
	mm_segment_t old_fs = get_fs();

	ptr += strlen("proc");
	ptr = skip_spaces(ptr);

	err = vfs_path_lookup(mnt->mnt_root, mnt, ptr, LOOKUP_FOLLOW, &nd);
	if (err) {
		mconsole_reply(req, "Failed to look up file", 1, 0);
		goto out;
	}

	err = may_open(&nd.path, MAY_READ, O_RDONLY);
	if (result) {
		mconsole_reply(req, "Failed to open file", 1, 0);
		path_put(&nd.path);
		goto out;
	}

	file = dentry_open(nd.path.dentry, nd.path.mnt, O_RDONLY,
			   current_cred());
	err = PTR_ERR(file);
	file = file_open_root(mnt->mnt_root, mnt, ptr, O_RDONLY);
	if (IS_ERR(file)) {
		mconsole_reply(req, "Failed to open file", 1, 0);
		path_put(&nd.path);
		goto out;
	}

+2 −0
Original line number Diff line number Diff line
@@ -851,4 +851,6 @@ ia32_sys_call_table:
	.quad sys_fanotify_init
	.quad sys32_fanotify_mark
	.quad sys_prlimit64		/* 340 */
	.quad sys_name_to_handle_at
	.quad compat_sys_open_by_handle_at
ia32_syscall_end:
Loading