aboutsummaryrefslogtreecommitdiffstats
path: root/fs/proc
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2012-06-10 16:03:43 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2012-07-14 08:34:14 -0400
commit0b728e1911cbe6e24020727c3870628b9653f32a (patch)
treecd975921b28300d62f3aca2fc37eef28af89b959 /fs/proc
parentfa3c56bbda6c2ac2a57d96ba501dbe85cccd312b (diff)
stop passing nameidata * to ->d_revalidate()
Just the lookup flags. Die, bastard, die... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/proc')
-rw-r--r--fs/proc/base.c22
-rw-r--r--fs/proc/internal.h2
-rw-r--r--fs/proc/namespaces.c2
-rw-r--r--fs/proc/proc_sysctl.c4
4 files changed, 15 insertions, 15 deletions
diff --git a/fs/proc/base.c b/fs/proc/base.c
index 437195f204e1..bf749cca4cc6 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -1601,13 +1601,13 @@ int pid_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat)
1601 * made this apply to all per process world readable and executable 1601 * made this apply to all per process world readable and executable
1602 * directories. 1602 * directories.
1603 */ 1603 */
1604int pid_revalidate(struct dentry *dentry, struct nameidata *nd) 1604int pid_revalidate(struct dentry *dentry, unsigned int flags)
1605{ 1605{
1606 struct inode *inode; 1606 struct inode *inode;
1607 struct task_struct *task; 1607 struct task_struct *task;
1608 const struct cred *cred; 1608 const struct cred *cred;
1609 1609
1610 if (nd && nd->flags & LOOKUP_RCU) 1610 if (flags & LOOKUP_RCU)
1611 return -ECHILD; 1611 return -ECHILD;
1612 1612
1613 inode = dentry->d_inode; 1613 inode = dentry->d_inode;
@@ -1781,7 +1781,7 @@ static int proc_fd_link(struct dentry *dentry, struct path *path)
1781 return proc_fd_info(dentry->d_inode, path, NULL); 1781 return proc_fd_info(dentry->d_inode, path, NULL);
1782} 1782}
1783 1783
1784static int tid_fd_revalidate(struct dentry *dentry, struct nameidata *nd) 1784static int tid_fd_revalidate(struct dentry *dentry, unsigned int flags)
1785{ 1785{
1786 struct inode *inode; 1786 struct inode *inode;
1787 struct task_struct *task; 1787 struct task_struct *task;
@@ -1789,7 +1789,7 @@ static int tid_fd_revalidate(struct dentry *dentry, struct nameidata *nd)
1789 struct files_struct *files; 1789 struct files_struct *files;
1790 const struct cred *cred; 1790 const struct cred *cred;
1791 1791
1792 if (nd && nd->flags & LOOKUP_RCU) 1792 if (flags & LOOKUP_RCU)
1793 return -ECHILD; 1793 return -ECHILD;
1794 1794
1795 inode = dentry->d_inode; 1795 inode = dentry->d_inode;
@@ -1868,7 +1868,7 @@ static struct dentry *proc_fd_instantiate(struct inode *dir,
1868 d_set_d_op(dentry, &tid_fd_dentry_operations); 1868 d_set_d_op(dentry, &tid_fd_dentry_operations);
1869 d_add(dentry, inode); 1869 d_add(dentry, inode);
1870 /* Close the race of the process dying before we return the dentry */ 1870 /* Close the race of the process dying before we return the dentry */
1871 if (tid_fd_revalidate(dentry, NULL)) 1871 if (tid_fd_revalidate(dentry, 0))
1872 error = NULL; 1872 error = NULL;
1873 1873
1874 out: 1874 out:
@@ -2003,7 +2003,7 @@ static int dname_to_vma_addr(struct dentry *dentry,
2003 return 0; 2003 return 0;
2004} 2004}
2005 2005
2006static int map_files_d_revalidate(struct dentry *dentry, struct nameidata *nd) 2006static int map_files_d_revalidate(struct dentry *dentry, unsigned int flags)
2007{ 2007{
2008 unsigned long vm_start, vm_end; 2008 unsigned long vm_start, vm_end;
2009 bool exact_vma_exists = false; 2009 bool exact_vma_exists = false;
@@ -2013,7 +2013,7 @@ static int map_files_d_revalidate(struct dentry *dentry, struct nameidata *nd)
2013 struct inode *inode; 2013 struct inode *inode;
2014 int status = 0; 2014 int status = 0;
2015 2015
2016 if (nd && nd->flags & LOOKUP_RCU) 2016 if (flags & LOOKUP_RCU)
2017 return -ECHILD; 2017 return -ECHILD;
2018 2018
2019 if (!capable(CAP_SYS_ADMIN)) { 2019 if (!capable(CAP_SYS_ADMIN)) {
@@ -2371,7 +2371,7 @@ static struct dentry *proc_fdinfo_instantiate(struct inode *dir,
2371 d_set_d_op(dentry, &tid_fd_dentry_operations); 2371 d_set_d_op(dentry, &tid_fd_dentry_operations);
2372 d_add(dentry, inode); 2372 d_add(dentry, inode);
2373 /* Close the race of the process dying before we return the dentry */ 2373 /* Close the race of the process dying before we return the dentry */
2374 if (tid_fd_revalidate(dentry, NULL)) 2374 if (tid_fd_revalidate(dentry, 0))
2375 error = NULL; 2375 error = NULL;
2376 2376
2377 out: 2377 out:
@@ -2430,7 +2430,7 @@ static struct dentry *proc_pident_instantiate(struct inode *dir,
2430 d_set_d_op(dentry, &pid_dentry_operations); 2430 d_set_d_op(dentry, &pid_dentry_operations);
2431 d_add(dentry, inode); 2431 d_add(dentry, inode);
2432 /* Close the race of the process dying before we return the dentry */ 2432 /* Close the race of the process dying before we return the dentry */
2433 if (pid_revalidate(dentry, NULL)) 2433 if (pid_revalidate(dentry, 0))
2434 error = NULL; 2434 error = NULL;
2435out: 2435out:
2436 return error; 2436 return error;
@@ -3237,7 +3237,7 @@ static struct dentry *proc_pid_instantiate(struct inode *dir,
3237 3237
3238 d_add(dentry, inode); 3238 d_add(dentry, inode);
3239 /* Close the race of the process dying before we return the dentry */ 3239 /* Close the race of the process dying before we return the dentry */
3240 if (pid_revalidate(dentry, NULL)) 3240 if (pid_revalidate(dentry, 0))
3241 error = NULL; 3241 error = NULL;
3242out: 3242out:
3243 return error; 3243 return error;
@@ -3508,7 +3508,7 @@ static struct dentry *proc_task_instantiate(struct inode *dir,
3508 3508
3509 d_add(dentry, inode); 3509 d_add(dentry, inode);
3510 /* Close the race of the process dying before we return the dentry */ 3510 /* Close the race of the process dying before we return the dentry */
3511 if (pid_revalidate(dentry, NULL)) 3511 if (pid_revalidate(dentry, 0))
3512 error = NULL; 3512 error = NULL;
3513out: 3513out:
3514 return error; 3514 return error;
diff --git a/fs/proc/internal.h b/fs/proc/internal.h
index eca4aca5b6e2..e0c2a48dab73 100644
--- a/fs/proc/internal.h
+++ b/fs/proc/internal.h
@@ -142,7 +142,7 @@ typedef struct dentry *instantiate_t(struct inode *, struct dentry *,
142int proc_fill_cache(struct file *filp, void *dirent, filldir_t filldir, 142int proc_fill_cache(struct file *filp, void *dirent, filldir_t filldir,
143 const char *name, int len, 143 const char *name, int len,
144 instantiate_t instantiate, struct task_struct *task, const void *ptr); 144 instantiate_t instantiate, struct task_struct *task, const void *ptr);
145int pid_revalidate(struct dentry *dentry, struct nameidata *nd); 145int pid_revalidate(struct dentry *dentry, unsigned int flags);
146struct inode *proc_pid_make_inode(struct super_block * sb, struct task_struct *task); 146struct inode *proc_pid_make_inode(struct super_block * sb, struct task_struct *task);
147extern const struct dentry_operations pid_dentry_operations; 147extern const struct dentry_operations pid_dentry_operations;
148int pid_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat); 148int pid_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat);
diff --git a/fs/proc/namespaces.c b/fs/proc/namespaces.c
index 0d9e23a39e49..40ceb40f9853 100644
--- a/fs/proc/namespaces.c
+++ b/fs/proc/namespaces.c
@@ -56,7 +56,7 @@ static struct dentry *proc_ns_instantiate(struct inode *dir,
56 d_set_d_op(dentry, &pid_dentry_operations); 56 d_set_d_op(dentry, &pid_dentry_operations);
57 d_add(dentry, inode); 57 d_add(dentry, inode);
58 /* Close the race of the process dying before we return the dentry */ 58 /* Close the race of the process dying before we return the dentry */
59 if (pid_revalidate(dentry, NULL)) 59 if (pid_revalidate(dentry, 0))
60 error = NULL; 60 error = NULL;
61out: 61out:
62 return error; 62 return error;
diff --git a/fs/proc/proc_sysctl.c b/fs/proc/proc_sysctl.c
index 3476bca8f7af..fda69fa39099 100644
--- a/fs/proc/proc_sysctl.c
+++ b/fs/proc/proc_sysctl.c
@@ -794,9 +794,9 @@ static const struct inode_operations proc_sys_dir_operations = {
794 .getattr = proc_sys_getattr, 794 .getattr = proc_sys_getattr,
795}; 795};
796 796
797static int proc_sys_revalidate(struct dentry *dentry, struct nameidata *nd) 797static int proc_sys_revalidate(struct dentry *dentry, unsigned int flags)
798{ 798{
799 if (nd->flags & LOOKUP_RCU) 799 if (flags & LOOKUP_RCU)
800 return -ECHILD; 800 return -ECHILD;
801 return !PROC_I(dentry->d_inode)->sysctl->unregistering; 801 return !PROC_I(dentry->d_inode)->sysctl->unregistering;
802} 802}