procfs: new helper - PDE_DATA(inode)
The only part of proc_dir_entry the code outside of fs/proc
really cares about is PDE(inode)->data. Provide a helper
for that; static inline for now, eventually will be moved
to fs/proc, along with the knowledge of struct proc_dir_entry
layout.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
diff --git a/fs/afs/proc.c b/fs/afs/proc.c
index 096b23f..526e4bbb 100644
--- a/fs/afs/proc.c
+++ b/fs/afs/proc.c
@@ -190,7 +190,7 @@
return ret;
m = file->private_data;
- m->private = PDE(inode)->data;
+ m->private = PDE_DATA(inode);
return 0;
}
@@ -448,7 +448,7 @@
struct seq_file *m;
int ret;
- cell = PDE(inode)->data;
+ cell = PDE_DATA(inode);
if (!cell)
return -ENOENT;
@@ -554,7 +554,7 @@
struct seq_file *m;
int ret;
- cell = PDE(inode)->data;
+ cell = PDE_DATA(inode);
if (!cell)
return -ENOENT;
@@ -659,7 +659,7 @@
struct seq_file *m;
int ret;
- cell = PDE(inode)->data;
+ cell = PDE_DATA(inode);
if (!cell)
return -ENOENT;
diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
index ee6614bd..28e421c 100644
--- a/fs/ext4/mballoc.c
+++ b/fs/ext4/mballoc.c
@@ -2149,7 +2149,7 @@
static int ext4_mb_seq_groups_open(struct inode *inode, struct file *file)
{
- struct super_block *sb = PDE(inode)->data;
+ struct super_block *sb = PDE_DATA(inode);
int rc;
rc = seq_open(file, &ext4_mb_seq_groups_ops);
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 5d6d5357..c655105 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -1802,7 +1802,7 @@
static int options_open_fs(struct inode *inode, struct file *file)
{
- return single_open(file, options_seq_show, PDE(inode)->data);
+ return single_open(file, options_seq_show, PDE_DATA(inode));
}
static const struct file_operations ext4_seq_options_fops = {
diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c
index ed10991..154592e 100644
--- a/fs/jbd2/journal.c
+++ b/fs/jbd2/journal.c
@@ -950,7 +950,7 @@
static int jbd2_seq_info_open(struct inode *inode, struct file *file)
{
- journal_t *journal = PDE(inode)->data;
+ journal_t *journal = PDE_DATA(inode);
struct jbd2_stats_proc_session *s;
int rc, size;
diff --git a/fs/proc/generic.c b/fs/proc/generic.c
index 51fcb20..c0ad720 100644
--- a/fs/proc/generic.c
+++ b/fs/proc/generic.c
@@ -346,7 +346,7 @@
static void *proc_follow_link(struct dentry *dentry, struct nameidata *nd)
{
- nd_set_link(nd, PDE(dentry->d_inode)->data);
+ nd_set_link(nd, PDE_DATA(dentry->d_inode));
return NULL;
}
diff --git a/fs/proc/proc_devtree.c b/fs/proc/proc_devtree.c
index 30b590f..e0043c7 100644
--- a/fs/proc/proc_devtree.c
+++ b/fs/proc/proc_devtree.c
@@ -41,7 +41,7 @@
static int property_proc_open(struct inode *inode, struct file *file)
{
- return single_open(file, property_proc_show, PDE(inode)->data);
+ return single_open(file, property_proc_show, PDE_DATA(inode));
}
static const struct file_operations property_proc_fops = {