open-style analog of vfs_path_lookup()
[linux-block.git] / arch / um / drivers / mconsole_kern.c
index 975613b23dcfb9cd0b60d46afa05260e733d90c2..c70e047eed72e192cd9d0a8ade7cc6f8302a9d6c 100644 (file)
@@ -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;
        }