summaryrefslogtreecommitdiff
path: root/fs/proc/internal.h
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2013-04-12 18:03:36 +0100
committerAl Viro <viro@zeniv.linux.org.uk>2013-05-01 17:29:47 -0400
commitc30480b92cf497aa3b463367a82f1c2fdc5c46e9 (patch)
treebe6dea0c5a45bd60a03ae99efdda0eb365db884a /fs/proc/internal.h
parenta8ca16ea7b0abb0a7e49492d1123b715f0ec62e8 (diff)
proc: Make the PROC_I() and PDE() macros internal to procfs
Make the PROC_I() and PDE() macros internal to procfs. This means making PDE_DATA() out of line. This could be made more optimal by storing PDE()->data into inode->i_private. Also provide a __PDE_DATA() that is inline and internal to procfs. Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/proc/internal.h')
-rw-r--r--fs/proc/internal.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/fs/proc/internal.h b/fs/proc/internal.h
index c529b5f16ee4..86a24060e1b9 100644
--- a/fs/proc/internal.h
+++ b/fs/proc/internal.h
@@ -84,6 +84,24 @@ struct proc_maps_private {
void proc_init_inodecache(void);
+/*
+ * General functions
+ */
+static inline struct proc_inode *PROC_I(const struct inode *inode)
+{
+ return container_of(inode, struct proc_inode, vfs_inode);
+}
+
+static inline struct proc_dir_entry *PDE(const struct inode *inode)
+{
+ return PROC_I(inode)->pde;
+}
+
+static inline void *__PDE_DATA(const struct inode *inode)
+{
+ return PDE(inode)->data;
+}
+
static inline struct pid *proc_pid(struct inode *inode)
{
return PROC_I(inode)->pid;