diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2013-06-15 03:15:20 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2013-06-29 04:57:18 -0400 |
commit | c52a47ace7ef58cbe06e6b48190fee7073dceccc (patch) | |
tree | 9a315f2905c2cb699e3572f192d574de0047f5a3 /fs/proc/namespaces.c | |
parent | db963164873f04d7fbdd418b4d023e2b3dee2945 (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.c | 13 |
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 | ||
190 | static struct dentry *proc_ns_instantiate(struct inode *dir, | 190 | static 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; |
212 | out: | 211 | out: |
213 | return error; | 212 | return -ENOENT; |
214 | } | 213 | } |
215 | 214 | ||
216 | static int proc_ns_dir_readdir(struct file *file, struct dir_context *ctx) | 215 | 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 = { | |||
248 | static struct dentry *proc_ns_dir_lookup(struct inode *dir, | 247 | static 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, | |||
272 | out: | 271 | out: |
273 | put_task_struct(task); | 272 | put_task_struct(task); |
274 | out_no_task: | 273 | out_no_task: |
275 | return error; | 274 | return ERR_PTR(error); |
276 | } | 275 | } |
277 | 276 | ||
278 | const struct inode_operations proc_ns_dir_inode_operations = { | 277 | const struct inode_operations proc_ns_dir_inode_operations = { |