summaryrefslogtreecommitdiffstats
path: root/fs/proc
diff options
context:
space:
mode:
Diffstat (limited to 'fs/proc')
-rw-r--r--fs/proc/base.c32
-rw-r--r--fs/proc/fd.c6
-rw-r--r--fs/proc/generic.c4
-rw-r--r--fs/proc/inode.c2
-rw-r--r--fs/proc/namespaces.c4
-rw-r--r--fs/proc/proc_net.c2
-rw-r--r--fs/proc/proc_sysctl.c12
-rw-r--r--fs/proc/root.c2
-rw-r--r--fs/proc/self.c2
-rw-r--r--fs/proc/thread_self.c2
10 files changed, 34 insertions, 34 deletions
diff --git a/fs/proc/base.c b/fs/proc/base.c
index 7a3b82f986dd..093ca14f5701 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -169,7 +169,7 @@ static int get_task_root(struct task_struct *task, struct path *root)
169 169
170static int proc_cwd_link(struct dentry *dentry, struct path *path) 170static int proc_cwd_link(struct dentry *dentry, struct path *path)
171{ 171{
172 struct task_struct *task = get_proc_task(dentry->d_inode); 172 struct task_struct *task = get_proc_task(d_inode(dentry));
173 int result = -ENOENT; 173 int result = -ENOENT;
174 174
175 if (task) { 175 if (task) {
@@ -186,7 +186,7 @@ static int proc_cwd_link(struct dentry *dentry, struct path *path)
186 186
187static int proc_root_link(struct dentry *dentry, struct path *path) 187static int proc_root_link(struct dentry *dentry, struct path *path)
188{ 188{
189 struct task_struct *task = get_proc_task(dentry->d_inode); 189 struct task_struct *task = get_proc_task(d_inode(dentry));
190 int result = -ENOENT; 190 int result = -ENOENT;
191 191
192 if (task) { 192 if (task) {
@@ -514,7 +514,7 @@ static int proc_fd_access_allowed(struct inode *inode)
514int proc_setattr(struct dentry *dentry, struct iattr *attr) 514int proc_setattr(struct dentry *dentry, struct iattr *attr)
515{ 515{
516 int error; 516 int error;
517 struct inode *inode = dentry->d_inode; 517 struct inode *inode = d_inode(dentry);
518 518
519 if (attr->ia_valid & ATTR_MODE) 519 if (attr->ia_valid & ATTR_MODE)
520 return -EPERM; 520 return -EPERM;
@@ -1362,7 +1362,7 @@ static int proc_exe_link(struct dentry *dentry, struct path *exe_path)
1362 struct mm_struct *mm; 1362 struct mm_struct *mm;
1363 struct file *exe_file; 1363 struct file *exe_file;
1364 1364
1365 task = get_proc_task(dentry->d_inode); 1365 task = get_proc_task(d_inode(dentry));
1366 if (!task) 1366 if (!task)
1367 return -ENOENT; 1367 return -ENOENT;
1368 mm = get_task_mm(task); 1368 mm = get_task_mm(task);
@@ -1382,7 +1382,7 @@ static int proc_exe_link(struct dentry *dentry, struct path *exe_path)
1382 1382
1383static void *proc_pid_follow_link(struct dentry *dentry, struct nameidata *nd) 1383static void *proc_pid_follow_link(struct dentry *dentry, struct nameidata *nd)
1384{ 1384{
1385 struct inode *inode = dentry->d_inode; 1385 struct inode *inode = d_inode(dentry);
1386 struct path path; 1386 struct path path;
1387 int error = -EACCES; 1387 int error = -EACCES;
1388 1388
@@ -1427,7 +1427,7 @@ static int do_proc_readlink(struct path *path, char __user *buffer, int buflen)
1427static int proc_pid_readlink(struct dentry * dentry, char __user * buffer, int buflen) 1427static int proc_pid_readlink(struct dentry * dentry, char __user * buffer, int buflen)
1428{ 1428{
1429 int error = -EACCES; 1429 int error = -EACCES;
1430 struct inode *inode = dentry->d_inode; 1430 struct inode *inode = d_inode(dentry);
1431 struct path path; 1431 struct path path;
1432 1432
1433 /* Are we allowed to snoop on the tasks file descriptors? */ 1433 /* Are we allowed to snoop on the tasks file descriptors? */
@@ -1497,7 +1497,7 @@ out_unlock:
1497 1497
1498int pid_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat) 1498int pid_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat)
1499{ 1499{
1500 struct inode *inode = dentry->d_inode; 1500 struct inode *inode = d_inode(dentry);
1501 struct task_struct *task; 1501 struct task_struct *task;
1502 const struct cred *cred; 1502 const struct cred *cred;
1503 struct pid_namespace *pid = dentry->d_sb->s_fs_info; 1503 struct pid_namespace *pid = dentry->d_sb->s_fs_info;
@@ -1554,7 +1554,7 @@ int pid_revalidate(struct dentry *dentry, unsigned int flags)
1554 if (flags & LOOKUP_RCU) 1554 if (flags & LOOKUP_RCU)
1555 return -ECHILD; 1555 return -ECHILD;
1556 1556
1557 inode = dentry->d_inode; 1557 inode = d_inode(dentry);
1558 task = get_proc_task(inode); 1558 task = get_proc_task(inode);
1559 1559
1560 if (task) { 1560 if (task) {
@@ -1588,7 +1588,7 @@ int pid_delete_dentry(const struct dentry *dentry)
1588 * If so, then don't put the dentry on the lru list, 1588 * If so, then don't put the dentry on the lru list,
1589 * kill it immediately. 1589 * kill it immediately.
1590 */ 1590 */
1591 return proc_inode_is_dead(dentry->d_inode); 1591 return proc_inode_is_dead(d_inode(dentry));
1592} 1592}
1593 1593
1594const struct dentry_operations pid_dentry_operations = 1594const struct dentry_operations pid_dentry_operations =
@@ -1626,12 +1626,12 @@ bool proc_fill_cache(struct file *file, struct dir_context *ctx,
1626 child = d_alloc(dir, &qname); 1626 child = d_alloc(dir, &qname);
1627 if (!child) 1627 if (!child)
1628 goto end_instantiate; 1628 goto end_instantiate;
1629 if (instantiate(dir->d_inode, child, task, ptr) < 0) { 1629 if (instantiate(d_inode(dir), child, task, ptr) < 0) {
1630 dput(child); 1630 dput(child);
1631 goto end_instantiate; 1631 goto end_instantiate;
1632 } 1632 }
1633 } 1633 }
1634 inode = child->d_inode; 1634 inode = d_inode(child);
1635 ino = inode->i_ino; 1635 ino = inode->i_ino;
1636 type = inode->i_mode >> 12; 1636 type = inode->i_mode >> 12;
1637 dput(child); 1637 dput(child);
@@ -1674,7 +1674,7 @@ static int map_files_d_revalidate(struct dentry *dentry, unsigned int flags)
1674 goto out_notask; 1674 goto out_notask;
1675 } 1675 }
1676 1676
1677 inode = dentry->d_inode; 1677 inode = d_inode(dentry);
1678 task = get_proc_task(inode); 1678 task = get_proc_task(inode);
1679 if (!task) 1679 if (!task)
1680 goto out_notask; 1680 goto out_notask;
@@ -1727,7 +1727,7 @@ static int proc_map_files_get_link(struct dentry *dentry, struct path *path)
1727 int rc; 1727 int rc;
1728 1728
1729 rc = -ENOENT; 1729 rc = -ENOENT;
1730 task = get_proc_task(dentry->d_inode); 1730 task = get_proc_task(d_inode(dentry));
1731 if (!task) 1731 if (!task)
1732 goto out; 1732 goto out;
1733 1733
@@ -2863,13 +2863,13 @@ int proc_pid_readdir(struct file *file, struct dir_context *ctx)
2863 return 0; 2863 return 0;
2864 2864
2865 if (pos == TGID_OFFSET - 2) { 2865 if (pos == TGID_OFFSET - 2) {
2866 struct inode *inode = ns->proc_self->d_inode; 2866 struct inode *inode = d_inode(ns->proc_self);
2867 if (!dir_emit(ctx, "self", 4, inode->i_ino, DT_LNK)) 2867 if (!dir_emit(ctx, "self", 4, inode->i_ino, DT_LNK))
2868 return 0; 2868 return 0;
2869 ctx->pos = pos = pos + 1; 2869 ctx->pos = pos = pos + 1;
2870 } 2870 }
2871 if (pos == TGID_OFFSET - 1) { 2871 if (pos == TGID_OFFSET - 1) {
2872 struct inode *inode = ns->proc_thread_self->d_inode; 2872 struct inode *inode = d_inode(ns->proc_thread_self);
2873 if (!dir_emit(ctx, "thread-self", 11, inode->i_ino, DT_LNK)) 2873 if (!dir_emit(ctx, "thread-self", 11, inode->i_ino, DT_LNK))
2874 return 0; 2874 return 0;
2875 ctx->pos = pos = pos + 1; 2875 ctx->pos = pos = pos + 1;
@@ -3188,7 +3188,7 @@ static int proc_task_readdir(struct file *file, struct dir_context *ctx)
3188 3188
3189static int proc_task_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat) 3189static int proc_task_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat)
3190{ 3190{
3191 struct inode *inode = dentry->d_inode; 3191 struct inode *inode = d_inode(dentry);
3192 struct task_struct *p = get_proc_task(inode); 3192 struct task_struct *p = get_proc_task(inode);
3193 generic_fillattr(inode, stat); 3193 generic_fillattr(inode, stat);
3194 3194
diff --git a/fs/proc/fd.c b/fs/proc/fd.c
index af84ad04df77..6e5fcd00733e 100644
--- a/fs/proc/fd.c
+++ b/fs/proc/fd.c
@@ -91,7 +91,7 @@ static int tid_fd_revalidate(struct dentry *dentry, unsigned int flags)
91 if (flags & LOOKUP_RCU) 91 if (flags & LOOKUP_RCU)
92 return -ECHILD; 92 return -ECHILD;
93 93
94 inode = dentry->d_inode; 94 inode = d_inode(dentry);
95 task = get_proc_task(inode); 95 task = get_proc_task(inode);
96 fd = proc_fd(inode); 96 fd = proc_fd(inode);
97 97
@@ -151,14 +151,14 @@ static int proc_fd_link(struct dentry *dentry, struct path *path)
151 struct task_struct *task; 151 struct task_struct *task;
152 int ret = -ENOENT; 152 int ret = -ENOENT;
153 153
154 task = get_proc_task(dentry->d_inode); 154 task = get_proc_task(d_inode(dentry));
155 if (task) { 155 if (task) {
156 files = get_files_struct(task); 156 files = get_files_struct(task);
157 put_task_struct(task); 157 put_task_struct(task);
158 } 158 }
159 159
160 if (files) { 160 if (files) {
161 int fd = proc_fd(dentry->d_inode); 161 int fd = proc_fd(d_inode(dentry));
162 struct file *fd_file; 162 struct file *fd_file;
163 163
164 spin_lock(&files->file_lock); 164 spin_lock(&files->file_lock);
diff --git a/fs/proc/generic.c b/fs/proc/generic.c
index be65b2082135..df6327a2b865 100644
--- a/fs/proc/generic.c
+++ b/fs/proc/generic.c
@@ -101,7 +101,7 @@ static bool pde_subdir_insert(struct proc_dir_entry *dir,
101 101
102static int proc_notify_change(struct dentry *dentry, struct iattr *iattr) 102static int proc_notify_change(struct dentry *dentry, struct iattr *iattr)
103{ 103{
104 struct inode *inode = dentry->d_inode; 104 struct inode *inode = d_inode(dentry);
105 struct proc_dir_entry *de = PDE(inode); 105 struct proc_dir_entry *de = PDE(inode);
106 int error; 106 int error;
107 107
@@ -120,7 +120,7 @@ static int proc_notify_change(struct dentry *dentry, struct iattr *iattr)
120static int proc_getattr(struct vfsmount *mnt, struct dentry *dentry, 120static int proc_getattr(struct vfsmount *mnt, struct dentry *dentry,
121 struct kstat *stat) 121 struct kstat *stat)
122{ 122{
123 struct inode *inode = dentry->d_inode; 123 struct inode *inode = d_inode(dentry);
124 struct proc_dir_entry *de = PDE(inode); 124 struct proc_dir_entry *de = PDE(inode);
125 if (de && de->nlink) 125 if (de && de->nlink)
126 set_nlink(inode, de->nlink); 126 set_nlink(inode, de->nlink);
diff --git a/fs/proc/inode.c b/fs/proc/inode.c
index 7697b6621cfd..8272aaba1bb0 100644
--- a/fs/proc/inode.c
+++ b/fs/proc/inode.c
@@ -396,7 +396,7 @@ static const struct file_operations proc_reg_file_ops_no_compat = {
396 396
397static void *proc_follow_link(struct dentry *dentry, struct nameidata *nd) 397static void *proc_follow_link(struct dentry *dentry, struct nameidata *nd)
398{ 398{
399 struct proc_dir_entry *pde = PDE(dentry->d_inode); 399 struct proc_dir_entry *pde = PDE(d_inode(dentry));
400 if (unlikely(!use_pde(pde))) 400 if (unlikely(!use_pde(pde)))
401 return ERR_PTR(-EINVAL); 401 return ERR_PTR(-EINVAL);
402 nd_set_link(nd, pde->data); 402 nd_set_link(nd, pde->data);
diff --git a/fs/proc/namespaces.c b/fs/proc/namespaces.c
index c9eac4563fa8..e512642dbbdc 100644
--- a/fs/proc/namespaces.c
+++ b/fs/proc/namespaces.c
@@ -32,7 +32,7 @@ static const struct proc_ns_operations *ns_entries[] = {
32 32
33static void *proc_ns_follow_link(struct dentry *dentry, struct nameidata *nd) 33static void *proc_ns_follow_link(struct dentry *dentry, struct nameidata *nd)
34{ 34{
35 struct inode *inode = dentry->d_inode; 35 struct inode *inode = d_inode(dentry);
36 const struct proc_ns_operations *ns_ops = PROC_I(inode)->ns_ops; 36 const struct proc_ns_operations *ns_ops = PROC_I(inode)->ns_ops;
37 struct task_struct *task; 37 struct task_struct *task;
38 struct path ns_path; 38 struct path ns_path;
@@ -53,7 +53,7 @@ static void *proc_ns_follow_link(struct dentry *dentry, struct nameidata *nd)
53 53
54static int proc_ns_readlink(struct dentry *dentry, char __user *buffer, int buflen) 54static int proc_ns_readlink(struct dentry *dentry, char __user *buffer, int buflen)
55{ 55{
56 struct inode *inode = dentry->d_inode; 56 struct inode *inode = d_inode(dentry);
57 const struct proc_ns_operations *ns_ops = PROC_I(inode)->ns_ops; 57 const struct proc_ns_operations *ns_ops = PROC_I(inode)->ns_ops;
58 struct task_struct *task; 58 struct task_struct *task;
59 char name[50]; 59 char name[50];
diff --git a/fs/proc/proc_net.c b/fs/proc/proc_net.c
index 1bde894bc624..350984a19c83 100644
--- a/fs/proc/proc_net.c
+++ b/fs/proc/proc_net.c
@@ -142,7 +142,7 @@ static struct dentry *proc_tgid_net_lookup(struct inode *dir,
142static int proc_tgid_net_getattr(struct vfsmount *mnt, struct dentry *dentry, 142static int proc_tgid_net_getattr(struct vfsmount *mnt, struct dentry *dentry,
143 struct kstat *stat) 143 struct kstat *stat)
144{ 144{
145 struct inode *inode = dentry->d_inode; 145 struct inode *inode = d_inode(dentry);
146 struct net *net; 146 struct net *net;
147 147
148 net = get_proc_task_net(inode); 148 net = get_proc_task_net(inode);
diff --git a/fs/proc/proc_sysctl.c b/fs/proc/proc_sysctl.c
index f92d5dd578a4..fea2561d773b 100644
--- a/fs/proc/proc_sysctl.c
+++ b/fs/proc/proc_sysctl.c
@@ -604,7 +604,7 @@ static bool proc_sys_fill_cache(struct file *file,
604 return false; 604 return false;
605 } 605 }
606 } 606 }
607 inode = child->d_inode; 607 inode = d_inode(child);
608 ino = inode->i_ino; 608 ino = inode->i_ino;
609 type = inode->i_mode >> 12; 609 type = inode->i_mode >> 12;
610 dput(child); 610 dput(child);
@@ -710,7 +710,7 @@ static int proc_sys_permission(struct inode *inode, int mask)
710 710
711static int proc_sys_setattr(struct dentry *dentry, struct iattr *attr) 711static int proc_sys_setattr(struct dentry *dentry, struct iattr *attr)
712{ 712{
713 struct inode *inode = dentry->d_inode; 713 struct inode *inode = d_inode(dentry);
714 int error; 714 int error;
715 715
716 if (attr->ia_valid & (ATTR_MODE | ATTR_UID | ATTR_GID)) 716 if (attr->ia_valid & (ATTR_MODE | ATTR_UID | ATTR_GID))
@@ -727,7 +727,7 @@ static int proc_sys_setattr(struct dentry *dentry, struct iattr *attr)
727 727
728static int proc_sys_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat) 728static int proc_sys_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat)
729{ 729{
730 struct inode *inode = dentry->d_inode; 730 struct inode *inode = d_inode(dentry);
731 struct ctl_table_header *head = grab_header(inode); 731 struct ctl_table_header *head = grab_header(inode);
732 struct ctl_table *table = PROC_I(inode)->sysctl_entry; 732 struct ctl_table *table = PROC_I(inode)->sysctl_entry;
733 733
@@ -773,12 +773,12 @@ static int proc_sys_revalidate(struct dentry *dentry, unsigned int flags)
773{ 773{
774 if (flags & LOOKUP_RCU) 774 if (flags & LOOKUP_RCU)
775 return -ECHILD; 775 return -ECHILD;
776 return !PROC_I(dentry->d_inode)->sysctl->unregistering; 776 return !PROC_I(d_inode(dentry))->sysctl->unregistering;
777} 777}
778 778
779static int proc_sys_delete(const struct dentry *dentry) 779static int proc_sys_delete(const struct dentry *dentry)
780{ 780{
781 return !!PROC_I(dentry->d_inode)->sysctl->unregistering; 781 return !!PROC_I(d_inode(dentry))->sysctl->unregistering;
782} 782}
783 783
784static int sysctl_is_seen(struct ctl_table_header *p) 784static int sysctl_is_seen(struct ctl_table_header *p)
@@ -805,7 +805,7 @@ static int proc_sys_compare(const struct dentry *parent, const struct dentry *de
805 /* Although proc doesn't have negative dentries, rcu-walk means 805 /* Although proc doesn't have negative dentries, rcu-walk means
806 * that inode here can be NULL */ 806 * that inode here can be NULL */
807 /* AV: can it, indeed? */ 807 /* AV: can it, indeed? */
808 inode = ACCESS_ONCE(dentry->d_inode); 808 inode = d_inode_rcu(dentry);
809 if (!inode) 809 if (!inode)
810 return 1; 810 return 1;
811 if (name->len != len) 811 if (name->len != len)
diff --git a/fs/proc/root.c b/fs/proc/root.c
index e74ac9f1a2c0..b7fa4bfe896a 100644
--- a/fs/proc/root.c
+++ b/fs/proc/root.c
@@ -195,7 +195,7 @@ void __init proc_root_init(void)
195static int proc_root_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat 195static int proc_root_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat
196) 196)
197{ 197{
198 generic_fillattr(dentry->d_inode, stat); 198 generic_fillattr(d_inode(dentry), stat);
199 stat->nlink = proc_root.nlink + nr_processes(); 199 stat->nlink = proc_root.nlink + nr_processes();
200 return 0; 200 return 0;
201} 201}
diff --git a/fs/proc/self.c b/fs/proc/self.c
index 4348bb8907c2..6195b4a7c3b1 100644
--- a/fs/proc/self.c
+++ b/fs/proc/self.c
@@ -46,7 +46,7 @@ static unsigned self_inum;
46 46
47int proc_setup_self(struct super_block *s) 47int proc_setup_self(struct super_block *s)
48{ 48{
49 struct inode *root_inode = s->s_root->d_inode; 49 struct inode *root_inode = d_inode(s->s_root);
50 struct pid_namespace *ns = s->s_fs_info; 50 struct pid_namespace *ns = s->s_fs_info;
51 struct dentry *self; 51 struct dentry *self;
52 52
diff --git a/fs/proc/thread_self.c b/fs/proc/thread_self.c
index 59075b509df3..a8371993b4fb 100644
--- a/fs/proc/thread_self.c
+++ b/fs/proc/thread_self.c
@@ -47,7 +47,7 @@ static unsigned thread_self_inum;
47 47
48int proc_setup_thread_self(struct super_block *s) 48int proc_setup_thread_self(struct super_block *s)
49{ 49{
50 struct inode *root_inode = s->s_root->d_inode; 50 struct inode *root_inode = d_inode(s->s_root);
51 struct pid_namespace *ns = s->s_fs_info; 51 struct pid_namespace *ns = s->s_fs_info;
52 struct dentry *thread_self; 52 struct dentry *thread_self;
53 53