Commit ffb37ca3 authored by Al Viro's avatar Al Viro
Browse files

switch file_open_root() to struct path



... and provide file_open_root_mnt(), using the root of given mount.

Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 4f0ed93f
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -890,3 +890,12 @@ been called or returned with non -EIOCBQUEUED code.

mnt_want_write_file() can now only be paired with mnt_drop_write_file(),
whereas previously it could be paired with mnt_drop_write() as well.

---

**mandatory**

Calling conventions for file_open_root() changed; now it takes struct path *
instead of passing mount and dentry separately.  For callers that used to
pass <mnt, mnt->mnt_root> pair (i.e. the root of given mount), a new helper
is provided - file_open_root_mnt().  In-tree users adjusted.
+1 −1
Original line number Diff line number Diff line
@@ -140,7 +140,7 @@ void mconsole_proc(struct mc_request *req)
		mconsole_reply(req, "Proc not available", 1, 0);
		goto out;
	}
	file = file_open_root(mnt->mnt_root, mnt, ptr, O_RDONLY, 0);
	file = file_open_root_mnt(mnt, ptr, O_RDONLY, 0);
	if (IS_ERR(file)) {
		mconsole_reply(req, "Failed to open file", 1, 0);
		printk(KERN_ERR "open /proc/%s: %ld\n", ptr, PTR_ERR(file));
+2 −2
Original line number Diff line number Diff line
@@ -755,8 +755,8 @@ void do_coredump(const kernel_siginfo_t *siginfo)
			task_lock(&init_task);
			get_fs_root(init_task.fs, &root);
			task_unlock(&init_task);
			cprm.file = file_open_root(root.dentry, root.mnt,
				cn.corename, open_flags, 0600);
			cprm.file = file_open_root(&root, cn.corename,
						   open_flags, 0600);
			path_put(&root);
		} else {
			cprm.file = filp_open(cn.corename, open_flags, 0600);
+1 −1
Original line number Diff line number Diff line
@@ -229,7 +229,7 @@ static long do_handle_open(int mountdirfd, struct file_handle __user *ufh,
		path_put(&path);
		return fd;
	}
	file = file_open_root(path.dentry, path.mnt, "", open_flag, 0);
	file = file_open_root(&path, "", open_flag, 0);
	if (IS_ERR(file)) {
		put_unused_fd(fd);
		retval =  PTR_ERR(file);
+1 −1
Original line number Diff line number Diff line
@@ -129,7 +129,7 @@ struct open_flags {
};
extern struct file *do_filp_open(int dfd, struct filename *pathname,
		const struct open_flags *op);
extern struct file *do_file_open_root(struct dentry *, struct vfsmount *,
extern struct file *do_file_open_root(const struct path *,
		const char *, const struct open_flags *);
extern struct open_how build_open_how(int flags, umode_t mode);
extern int build_open_flags(const struct open_how *how, struct open_flags *op);
Loading