aboutsummaryrefslogtreecommitdiffstats
path: root/fs/proc/namespaces.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2013-06-15 03:15:20 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2013-06-29 04:57:18 -0400
commitc52a47ace7ef58cbe06e6b48190fee7073dceccc (patch)
tree9a315f2905c2cb699e3572f192d574de0047f5a3 /fs/proc/namespaces.c
parentdb963164873f04d7fbdd418b4d023e2b3dee2945 (diff)
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.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/fs/proc/namespaces.c b/fs/proc/namespaces.c
index f6abbbbfad8a..49a7fff2e83a 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 = {
187 .setattr = proc_setattr, 187 .setattr = proc_setattr,
188}; 188};
189 189
190static struct dentry *proc_ns_instantiate(struct inode *dir, 190static int proc_ns_instantiate(struct inode *dir,
191 struct dentry *dentry, struct task_struct *task, const void *ptr) 191 struct dentry *dentry, struct task_struct *task, const void *ptr)
192{ 192{
193 const struct proc_ns_operations *ns_ops = ptr; 193 const struct proc_ns_operations *ns_ops = ptr;
194 struct inode *inode; 194 struct inode *inode;
195 struct proc_inode *ei; 195 struct proc_inode *ei;
196 struct dentry *error = ERR_PTR(-ENOENT);
197 196
198 inode = proc_pid_make_inode(dir->i_sb, task); 197 inode = proc_pid_make_inode(dir->i_sb, task);
199 if (!inode) 198 if (!inode)
@@ -208,9 +207,9 @@ static struct dentry *proc_ns_instantiate(struct inode *dir,
208 d_add(dentry, inode); 207 d_add(dentry, inode);
209 /* Close the race of the process dying before we return the dentry */ 208 /* Close the race of the process dying before we return the dentry */
210 if (pid_revalidate(dentry, 0)) 209 if (pid_revalidate(dentry, 0))
211 error = NULL; 210 return 0;
212out: 211out:
213 return error; 212 return -ENOENT;
214} 213}
215 214
216static int proc_ns_dir_readdir(struct file *file, struct dir_context *ctx) 215static int proc_ns_dir_readdir(struct file *file, struct dir_context *ctx)
@@ -248,12 +247,12 @@ const struct file_operations proc_ns_dir_operations = {
248static struct dentry *proc_ns_dir_lookup(struct inode *dir, 247static struct dentry *proc_ns_dir_lookup(struct inode *dir,
249 struct dentry *dentry, unsigned int flags) 248 struct dentry *dentry, unsigned int flags)
250{ 249{
251 struct dentry *error; 250 int error;
252 struct task_struct *task = get_proc_task(dir); 251 struct task_struct *task = get_proc_task(dir);
253 const struct proc_ns_operations **entry, **last; 252 const struct proc_ns_operations **entry, **last;
254 unsigned int len = dentry->d_name.len; 253 unsigned int len = dentry->d_name.len;
255 254
256 error = ERR_PTR(-ENOENT); 255 error = -ENOENT;
257 256
258 if (!task) 257 if (!task)
259 goto out_no_task; 258 goto out_no_task;
@@ -272,7 +271,7 @@ static struct dentry *proc_ns_dir_lookup(struct inode *dir,
272out: 271out:
273 put_task_struct(task); 272 put_task_struct(task);
274out_no_task: 273out_no_task:
275 return error; 274 return ERR_PTR(error);
276} 275}
277 276
278const struct inode_operations proc_ns_dir_inode_operations = { 277const struct inode_operations proc_ns_dir_inode_operations = {