diff options
author | David Howells <dhowells@redhat.com> | 2015-03-17 18:25:59 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2015-04-15 15:06:57 -0400 |
commit | 2b0143b5c986be1ce8408b3aadc4709e0a94429d (patch) | |
tree | 98b1dee70f3d5d9ac9309f4638e41864ddcd0952 /fs/proc/base.c | |
parent | ce0b16ddf18df35026164fda4a642ef10c01f442 (diff) |
VFS: normal filesystems (and lustre): d_inode() annotations
that's the bulk of filesystem drivers dealing with inodes of their own
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/proc/base.c')
-rw-r--r-- | fs/proc/base.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/fs/proc/base.c b/fs/proc/base.c index 3f3d7aeb0712..a3d6b559178b 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 | ||
170 | static int proc_cwd_link(struct dentry *dentry, struct path *path) | 170 | static 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 | ||
187 | static int proc_root_link(struct dentry *dentry, struct path *path) | 187 | static 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) { |
@@ -505,7 +505,7 @@ static int proc_fd_access_allowed(struct inode *inode) | |||
505 | int proc_setattr(struct dentry *dentry, struct iattr *attr) | 505 | int proc_setattr(struct dentry *dentry, struct iattr *attr) |
506 | { | 506 | { |
507 | int error; | 507 | int error; |
508 | struct inode *inode = dentry->d_inode; | 508 | struct inode *inode = d_inode(dentry); |
509 | 509 | ||
510 | if (attr->ia_valid & ATTR_MODE) | 510 | if (attr->ia_valid & ATTR_MODE) |
511 | return -EPERM; | 511 | return -EPERM; |
@@ -1353,7 +1353,7 @@ static int proc_exe_link(struct dentry *dentry, struct path *exe_path) | |||
1353 | struct mm_struct *mm; | 1353 | struct mm_struct *mm; |
1354 | struct file *exe_file; | 1354 | struct file *exe_file; |
1355 | 1355 | ||
1356 | task = get_proc_task(dentry->d_inode); | 1356 | task = get_proc_task(d_inode(dentry)); |
1357 | if (!task) | 1357 | if (!task) |
1358 | return -ENOENT; | 1358 | return -ENOENT; |
1359 | mm = get_task_mm(task); | 1359 | mm = get_task_mm(task); |
@@ -1373,7 +1373,7 @@ static int proc_exe_link(struct dentry *dentry, struct path *exe_path) | |||
1373 | 1373 | ||
1374 | static void *proc_pid_follow_link(struct dentry *dentry, struct nameidata *nd) | 1374 | static void *proc_pid_follow_link(struct dentry *dentry, struct nameidata *nd) |
1375 | { | 1375 | { |
1376 | struct inode *inode = dentry->d_inode; | 1376 | struct inode *inode = d_inode(dentry); |
1377 | struct path path; | 1377 | struct path path; |
1378 | int error = -EACCES; | 1378 | int error = -EACCES; |
1379 | 1379 | ||
@@ -1418,7 +1418,7 @@ static int do_proc_readlink(struct path *path, char __user *buffer, int buflen) | |||
1418 | static int proc_pid_readlink(struct dentry * dentry, char __user * buffer, int buflen) | 1418 | static int proc_pid_readlink(struct dentry * dentry, char __user * buffer, int buflen) |
1419 | { | 1419 | { |
1420 | int error = -EACCES; | 1420 | int error = -EACCES; |
1421 | struct inode *inode = dentry->d_inode; | 1421 | struct inode *inode = d_inode(dentry); |
1422 | struct path path; | 1422 | struct path path; |
1423 | 1423 | ||
1424 | /* Are we allowed to snoop on the tasks file descriptors? */ | 1424 | /* Are we allowed to snoop on the tasks file descriptors? */ |
@@ -1488,7 +1488,7 @@ out_unlock: | |||
1488 | 1488 | ||
1489 | int pid_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat) | 1489 | int pid_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat) |
1490 | { | 1490 | { |
1491 | struct inode *inode = dentry->d_inode; | 1491 | struct inode *inode = d_inode(dentry); |
1492 | struct task_struct *task; | 1492 | struct task_struct *task; |
1493 | const struct cred *cred; | 1493 | const struct cred *cred; |
1494 | struct pid_namespace *pid = dentry->d_sb->s_fs_info; | 1494 | struct pid_namespace *pid = dentry->d_sb->s_fs_info; |
@@ -1545,7 +1545,7 @@ int pid_revalidate(struct dentry *dentry, unsigned int flags) | |||
1545 | if (flags & LOOKUP_RCU) | 1545 | if (flags & LOOKUP_RCU) |
1546 | return -ECHILD; | 1546 | return -ECHILD; |
1547 | 1547 | ||
1548 | inode = dentry->d_inode; | 1548 | inode = d_inode(dentry); |
1549 | task = get_proc_task(inode); | 1549 | task = get_proc_task(inode); |
1550 | 1550 | ||
1551 | if (task) { | 1551 | if (task) { |
@@ -1579,7 +1579,7 @@ int pid_delete_dentry(const struct dentry *dentry) | |||
1579 | * If so, then don't put the dentry on the lru list, | 1579 | * If so, then don't put the dentry on the lru list, |
1580 | * kill it immediately. | 1580 | * kill it immediately. |
1581 | */ | 1581 | */ |
1582 | return proc_inode_is_dead(dentry->d_inode); | 1582 | return proc_inode_is_dead(d_inode(dentry)); |
1583 | } | 1583 | } |
1584 | 1584 | ||
1585 | const struct dentry_operations pid_dentry_operations = | 1585 | const struct dentry_operations pid_dentry_operations = |
@@ -1617,12 +1617,12 @@ bool proc_fill_cache(struct file *file, struct dir_context *ctx, | |||
1617 | child = d_alloc(dir, &qname); | 1617 | child = d_alloc(dir, &qname); |
1618 | if (!child) | 1618 | if (!child) |
1619 | goto end_instantiate; | 1619 | goto end_instantiate; |
1620 | if (instantiate(dir->d_inode, child, task, ptr) < 0) { | 1620 | if (instantiate(d_inode(dir), child, task, ptr) < 0) { |
1621 | dput(child); | 1621 | dput(child); |
1622 | goto end_instantiate; | 1622 | goto end_instantiate; |
1623 | } | 1623 | } |
1624 | } | 1624 | } |
1625 | inode = child->d_inode; | 1625 | inode = d_inode(child); |
1626 | ino = inode->i_ino; | 1626 | ino = inode->i_ino; |
1627 | type = inode->i_mode >> 12; | 1627 | type = inode->i_mode >> 12; |
1628 | dput(child); | 1628 | dput(child); |
@@ -1665,7 +1665,7 @@ static int map_files_d_revalidate(struct dentry *dentry, unsigned int flags) | |||
1665 | goto out_notask; | 1665 | goto out_notask; |
1666 | } | 1666 | } |
1667 | 1667 | ||
1668 | inode = dentry->d_inode; | 1668 | inode = d_inode(dentry); |
1669 | task = get_proc_task(inode); | 1669 | task = get_proc_task(inode); |
1670 | if (!task) | 1670 | if (!task) |
1671 | goto out_notask; | 1671 | goto out_notask; |
@@ -1718,7 +1718,7 @@ static int proc_map_files_get_link(struct dentry *dentry, struct path *path) | |||
1718 | int rc; | 1718 | int rc; |
1719 | 1719 | ||
1720 | rc = -ENOENT; | 1720 | rc = -ENOENT; |
1721 | task = get_proc_task(dentry->d_inode); | 1721 | task = get_proc_task(d_inode(dentry)); |
1722 | if (!task) | 1722 | if (!task) |
1723 | goto out; | 1723 | goto out; |
1724 | 1724 | ||
@@ -2851,13 +2851,13 @@ int proc_pid_readdir(struct file *file, struct dir_context *ctx) | |||
2851 | return 0; | 2851 | return 0; |
2852 | 2852 | ||
2853 | if (pos == TGID_OFFSET - 2) { | 2853 | if (pos == TGID_OFFSET - 2) { |
2854 | struct inode *inode = ns->proc_self->d_inode; | 2854 | struct inode *inode = d_inode(ns->proc_self); |
2855 | if (!dir_emit(ctx, "self", 4, inode->i_ino, DT_LNK)) | 2855 | if (!dir_emit(ctx, "self", 4, inode->i_ino, DT_LNK)) |
2856 | return 0; | 2856 | return 0; |
2857 | ctx->pos = pos = pos + 1; | 2857 | ctx->pos = pos = pos + 1; |
2858 | } | 2858 | } |
2859 | if (pos == TGID_OFFSET - 1) { | 2859 | if (pos == TGID_OFFSET - 1) { |
2860 | struct inode *inode = ns->proc_thread_self->d_inode; | 2860 | struct inode *inode = d_inode(ns->proc_thread_self); |
2861 | if (!dir_emit(ctx, "thread-self", 11, inode->i_ino, DT_LNK)) | 2861 | if (!dir_emit(ctx, "thread-self", 11, inode->i_ino, DT_LNK)) |
2862 | return 0; | 2862 | return 0; |
2863 | ctx->pos = pos = pos + 1; | 2863 | ctx->pos = pos = pos + 1; |
@@ -3176,7 +3176,7 @@ static int proc_task_readdir(struct file *file, struct dir_context *ctx) | |||
3176 | 3176 | ||
3177 | static int proc_task_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat) | 3177 | static int proc_task_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat) |
3178 | { | 3178 | { |
3179 | struct inode *inode = dentry->d_inode; | 3179 | struct inode *inode = d_inode(dentry); |
3180 | struct task_struct *p = get_proc_task(inode); | 3180 | struct task_struct *p = get_proc_task(inode); |
3181 | generic_fillattr(inode, stat); | 3181 | generic_fillattr(inode, stat); |
3182 | 3182 | ||