diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2013-06-15 11:15:20 +0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2013-06-29 12:57:18 +0400 |
commit | c52a47ace7ef58cbe06e6b48190fee7073dceccc (patch) | |
tree | 9a315f2905c2cb699e3572f192d574de0047f5a3 /fs/proc/namespaces.c | |
parent | db963164873f04d7fbdd418b4d023e2b3dee2945 (diff) | |
download | kernel_goldelico_gta04-c52a47ace7ef58cbe06e6b48190fee7073dceccc.zip kernel_goldelico_gta04-c52a47ace7ef58cbe06e6b48190fee7073dceccc.tar.gz kernel_goldelico_gta04-c52a47ace7ef58cbe06e6b48190fee7073dceccc.tar.bz2 |
proc_fill_cache(): just make instantiate_t return int
all instances always return ERR_PTR(-E...) or NULL, anyway
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/proc/namespaces.c')
-rw-r--r-- | fs/proc/namespaces.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/fs/proc/namespaces.c b/fs/proc/namespaces.c index f6abbbb..49a7fff 100644 --- a/fs/proc/namespaces.c +++ b/fs/proc/namespaces.c @@ -187,13 +187,12 @@ static const struct inode_operations proc_ns_link_inode_operations = { .setattr = proc_setattr, }; -static struct dentry *proc_ns_instantiate(struct inode *dir, +static int proc_ns_instantiate(struct inode *dir, struct dentry *dentry, struct task_struct *task, const void *ptr) { const struct proc_ns_operations *ns_ops = ptr; struct inode *inode; struct proc_inode *ei; - struct dentry *error = ERR_PTR(-ENOENT); inode = proc_pid_make_inode(dir->i_sb, task); if (!inode) @@ -208,9 +207,9 @@ static struct dentry *proc_ns_instantiate(struct inode *dir, d_add(dentry, inode); /* Close the race of the process dying before we return the dentry */ if (pid_revalidate(dentry, 0)) - error = NULL; + return 0; out: - return error; + return -ENOENT; } static int proc_ns_dir_readdir(struct file *file, struct dir_context *ctx) @@ -248,12 +247,12 @@ const struct file_operations proc_ns_dir_operations = { static struct dentry *proc_ns_dir_lookup(struct inode *dir, struct dentry *dentry, unsigned int flags) { - struct dentry *error; + int error; struct task_struct *task = get_proc_task(dir); const struct proc_ns_operations **entry, **last; unsigned int len = dentry->d_name.len; - error = ERR_PTR(-ENOENT); + error = -ENOENT; if (!task) goto out_no_task; @@ -272,7 +271,7 @@ static struct dentry *proc_ns_dir_lookup(struct inode *dir, out: put_task_struct(task); out_no_task: - return error; + return ERR_PTR(error); } const struct inode_operations proc_ns_dir_inode_operations = { |