aboutsummaryrefslogtreecommitdiffstats
path: root/fs/proc/generic.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2018-02-07 01:15:42 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2018-02-07 01:15:42 -0500
commita2e5790d841658485d642196dbb0927303d6c22f (patch)
treeb3d28c9bcb7da6880806146fd22a88a7ee7f733e /fs/proc/generic.c
parentab2d92ad881da11331280aedf612d82e61cb6d41 (diff)
parent60c3e026d73ccabb075fb70ba02f8512ab40cf2c (diff)
Merge branch 'akpm' (patches from Andrew)
Merge misc updates from Andrew Morton: - kasan updates - procfs - lib/bitmap updates - other lib/ updates - checkpatch tweaks - rapidio - ubsan - pipe fixes and cleanups - lots of other misc bits * emailed patches from Andrew Morton <akpm@linux-foundation.org>: (114 commits) Documentation/sysctl/user.txt: fix typo MAINTAINERS: update ARM/QUALCOMM SUPPORT patterns MAINTAINERS: update various PALM patterns MAINTAINERS: update "ARM/OXNAS platform support" patterns MAINTAINERS: update Cortina/Gemini patterns MAINTAINERS: remove ARM/CLKDEV SUPPORT file pattern MAINTAINERS: remove ANDROID ION pattern mm: docs: add blank lines to silence sphinx "Unexpected indentation" errors mm: docs: fix parameter names mismatch mm: docs: fixup punctuation pipe: read buffer limits atomically pipe: simplify round_pipe_size() pipe: reject F_SETPIPE_SZ with size over UINT_MAX pipe: fix off-by-one error when checking buffer limits pipe: actually allow root to exceed the pipe buffer limits pipe, sysctl: remove pipe_proc_fn() pipe, sysctl: drop 'min' parameter from pipe-max-size converter kasan: rework Kconfig settings crash_dump: is_kdump_kernel can be boolean kernel/mutex: mutex_is_locked can be boolean ...
Diffstat (limited to 'fs/proc/generic.c')
-rw-r--r--fs/proc/generic.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/fs/proc/generic.c b/fs/proc/generic.c
index 793a67574668..5d709fa8f3a2 100644
--- a/fs/proc/generic.c
+++ b/fs/proc/generic.c
@@ -28,7 +28,7 @@
28 28
29static DEFINE_RWLOCK(proc_subdir_lock); 29static DEFINE_RWLOCK(proc_subdir_lock);
30 30
31static int proc_match(unsigned int len, const char *name, struct proc_dir_entry *de) 31static int proc_match(const char *name, struct proc_dir_entry *de, unsigned int len)
32{ 32{
33 if (len < de->namelen) 33 if (len < de->namelen)
34 return -1; 34 return -1;
@@ -60,7 +60,7 @@ static struct proc_dir_entry *pde_subdir_find(struct proc_dir_entry *dir,
60 struct proc_dir_entry *de = rb_entry(node, 60 struct proc_dir_entry *de = rb_entry(node,
61 struct proc_dir_entry, 61 struct proc_dir_entry,
62 subdir_node); 62 subdir_node);
63 int result = proc_match(len, name, de); 63 int result = proc_match(name, de, len);
64 64
65 if (result < 0) 65 if (result < 0)
66 node = node->rb_left; 66 node = node->rb_left;
@@ -84,7 +84,7 @@ static bool pde_subdir_insert(struct proc_dir_entry *dir,
84 struct proc_dir_entry *this = rb_entry(*new, 84 struct proc_dir_entry *this = rb_entry(*new,
85 struct proc_dir_entry, 85 struct proc_dir_entry,
86 subdir_node); 86 subdir_node);
87 int result = proc_match(de->namelen, de->name, this); 87 int result = proc_match(de->name, this, de->namelen);
88 88
89 parent = *new; 89 parent = *new;
90 if (result < 0) 90 if (result < 0)
@@ -211,8 +211,8 @@ void proc_free_inum(unsigned int inum)
211 * Don't create negative dentries here, return -ENOENT by hand 211 * Don't create negative dentries here, return -ENOENT by hand
212 * instead. 212 * instead.
213 */ 213 */
214struct dentry *proc_lookup_de(struct proc_dir_entry *de, struct inode *dir, 214struct dentry *proc_lookup_de(struct inode *dir, struct dentry *dentry,
215 struct dentry *dentry) 215 struct proc_dir_entry *de)
216{ 216{
217 struct inode *inode; 217 struct inode *inode;
218 218
@@ -235,7 +235,7 @@ struct dentry *proc_lookup_de(struct proc_dir_entry *de, struct inode *dir,
235struct dentry *proc_lookup(struct inode *dir, struct dentry *dentry, 235struct dentry *proc_lookup(struct inode *dir, struct dentry *dentry,
236 unsigned int flags) 236 unsigned int flags)
237{ 237{
238 return proc_lookup_de(PDE(dir), dir, dentry); 238 return proc_lookup_de(dir, dentry, PDE(dir));
239} 239}
240 240
241/* 241/*
@@ -247,8 +247,8 @@ struct dentry *proc_lookup(struct inode *dir, struct dentry *dentry,
247 * value of the readdir() call, as long as it's non-negative 247 * value of the readdir() call, as long as it's non-negative
248 * for success.. 248 * for success..
249 */ 249 */
250int proc_readdir_de(struct proc_dir_entry *de, struct file *file, 250int proc_readdir_de(struct file *file, struct dir_context *ctx,
251 struct dir_context *ctx) 251 struct proc_dir_entry *de)
252{ 252{
253 int i; 253 int i;
254 254
@@ -292,7 +292,7 @@ int proc_readdir(struct file *file, struct dir_context *ctx)
292{ 292{
293 struct inode *inode = file_inode(file); 293 struct inode *inode = file_inode(file);
294 294
295 return proc_readdir_de(PDE(inode), file, ctx); 295 return proc_readdir_de(file, ctx, PDE(inode));
296} 296}
297 297
298/* 298/*