aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ia64
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2013-03-31 18:16:14 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2013-04-09 14:13:32 -0400
commitd9dda78bad879595d8c4220a067fc029d6484a16 (patch)
tree376c47ed566b719009e753e917104b150a639b11 /arch/ia64
parent8510e30b46cd5467b2f930bef68a276dbc2c7d7c (diff)
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>
Diffstat (limited to 'arch/ia64')
-rw-r--r--arch/ia64/kernel/salinfo.c18
1 files changed, 5 insertions, 13 deletions
diff --git a/arch/ia64/kernel/salinfo.c b/arch/ia64/kernel/salinfo.c
index aa527d7e91f2..a97d75b9c5ec 100644
--- a/arch/ia64/kernel/salinfo.c
+++ b/arch/ia64/kernel/salinfo.c
@@ -301,9 +301,7 @@ salinfo_event_open(struct inode *inode, struct file *file)
301static ssize_t 301static ssize_t
302salinfo_event_read(struct file *file, char __user *buffer, size_t count, loff_t *ppos) 302salinfo_event_read(struct file *file, char __user *buffer, size_t count, loff_t *ppos)
303{ 303{
304 struct inode *inode = file_inode(file); 304 struct salinfo_data *data = PDE_DATA(file_inode(file));
305 struct proc_dir_entry *entry = PDE(inode);
306 struct salinfo_data *data = entry->data;
307 char cmd[32]; 305 char cmd[32];
308 size_t size; 306 size_t size;
309 int i, n, cpu = -1; 307 int i, n, cpu = -1;
@@ -360,8 +358,7 @@ static const struct file_operations salinfo_event_fops = {
360static int 358static int
361salinfo_log_open(struct inode *inode, struct file *file) 359salinfo_log_open(struct inode *inode, struct file *file)
362{ 360{
363 struct proc_dir_entry *entry = PDE(inode); 361 struct salinfo_data *data = PDE_DATA(inode);
364 struct salinfo_data *data = entry->data;
365 362
366 if (!capable(CAP_SYS_ADMIN)) 363 if (!capable(CAP_SYS_ADMIN))
367 return -EPERM; 364 return -EPERM;
@@ -386,8 +383,7 @@ salinfo_log_open(struct inode *inode, struct file *file)
386static int 383static int
387salinfo_log_release(struct inode *inode, struct file *file) 384salinfo_log_release(struct inode *inode, struct file *file)
388{ 385{
389 struct proc_dir_entry *entry = PDE(inode); 386 struct salinfo_data *data = PDE_DATA(inode);
390 struct salinfo_data *data = entry->data;
391 387
392 if (data->state == STATE_NO_DATA) { 388 if (data->state == STATE_NO_DATA) {
393 vfree(data->log_buffer); 389 vfree(data->log_buffer);
@@ -463,9 +459,7 @@ retry:
463static ssize_t 459static ssize_t
464salinfo_log_read(struct file *file, char __user *buffer, size_t count, loff_t *ppos) 460salinfo_log_read(struct file *file, char __user *buffer, size_t count, loff_t *ppos)
465{ 461{
466 struct inode *inode = file_inode(file); 462 struct salinfo_data *data = PDE_DATA(file_inode(file));
467 struct proc_dir_entry *entry = PDE(inode);
468 struct salinfo_data *data = entry->data;
469 u8 *buf; 463 u8 *buf;
470 u64 bufsize; 464 u64 bufsize;
471 465
@@ -524,9 +518,7 @@ salinfo_log_clear(struct salinfo_data *data, int cpu)
524static ssize_t 518static ssize_t
525salinfo_log_write(struct file *file, const char __user *buffer, size_t count, loff_t *ppos) 519salinfo_log_write(struct file *file, const char __user *buffer, size_t count, loff_t *ppos)
526{ 520{
527 struct inode *inode = file_inode(file); 521 struct salinfo_data *data = PDE_DATA(file_inode(file));
528 struct proc_dir_entry *entry = PDE(inode);
529 struct salinfo_data *data = entry->data;
530 char cmd[32]; 522 char cmd[32];
531 size_t size; 523 size_t size;
532 u32 offset; 524 u32 offset;