diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2013-01-23 17:07:38 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2013-02-22 23:31:31 -0500 |
commit | 496ad9aa8ef448058e36ca7a787c61f2e63f0f54 (patch) | |
tree | 8f4abde793cd7db5bb8fde6d27ebcacd0e54379a /arch/powerpc | |
parent | 57eccb830f1cc93d4b506ba306d8dfa685e0c88f (diff) |
new helper: file_inode(file)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'arch/powerpc')
-rw-r--r-- | arch/powerpc/kernel/proc_powerpc.c | 6 | ||||
-rw-r--r-- | arch/powerpc/kernel/rtas_flash.c | 16 | ||||
-rw-r--r-- | arch/powerpc/platforms/cell/spufs/coredump.c | 4 | ||||
-rw-r--r-- | arch/powerpc/platforms/cell/spufs/file.c | 6 | ||||
-rw-r--r-- | arch/powerpc/platforms/cell/spufs/inode.c | 2 | ||||
-rw-r--r-- | arch/powerpc/platforms/cell/spufs/syscalls.c | 2 | ||||
-rw-r--r-- | arch/powerpc/platforms/pseries/hvCall_inst.c | 2 | ||||
-rw-r--r-- | arch/powerpc/platforms/pseries/scanlog.c | 8 |
8 files changed, 21 insertions, 25 deletions
diff --git a/arch/powerpc/kernel/proc_powerpc.c b/arch/powerpc/kernel/proc_powerpc.c index c8ae3714e79b..f19d0bdc3241 100644 --- a/arch/powerpc/kernel/proc_powerpc.c +++ b/arch/powerpc/kernel/proc_powerpc.c | |||
@@ -32,7 +32,7 @@ | |||
32 | static loff_t page_map_seek( struct file *file, loff_t off, int whence) | 32 | static loff_t page_map_seek( struct file *file, loff_t off, int whence) |
33 | { | 33 | { |
34 | loff_t new; | 34 | loff_t new; |
35 | struct proc_dir_entry *dp = PDE(file->f_path.dentry->d_inode); | 35 | struct proc_dir_entry *dp = PDE(file_inode(file)); |
36 | 36 | ||
37 | switch(whence) { | 37 | switch(whence) { |
38 | case 0: | 38 | case 0: |
@@ -55,13 +55,13 @@ static loff_t page_map_seek( struct file *file, loff_t off, int whence) | |||
55 | static ssize_t page_map_read( struct file *file, char __user *buf, size_t nbytes, | 55 | static ssize_t page_map_read( struct file *file, char __user *buf, size_t nbytes, |
56 | loff_t *ppos) | 56 | loff_t *ppos) |
57 | { | 57 | { |
58 | struct proc_dir_entry *dp = PDE(file->f_path.dentry->d_inode); | 58 | struct proc_dir_entry *dp = PDE(file_inode(file)); |
59 | return simple_read_from_buffer(buf, nbytes, ppos, dp->data, dp->size); | 59 | return simple_read_from_buffer(buf, nbytes, ppos, dp->data, dp->size); |
60 | } | 60 | } |
61 | 61 | ||
62 | static int page_map_mmap( struct file *file, struct vm_area_struct *vma ) | 62 | static int page_map_mmap( struct file *file, struct vm_area_struct *vma ) |
63 | { | 63 | { |
64 | struct proc_dir_entry *dp = PDE(file->f_path.dentry->d_inode); | 64 | struct proc_dir_entry *dp = PDE(file_inode(file)); |
65 | 65 | ||
66 | if ((vma->vm_end - vma->vm_start) > dp->size) | 66 | if ((vma->vm_end - vma->vm_start) > dp->size) |
67 | return -EINVAL; | 67 | return -EINVAL; |
diff --git a/arch/powerpc/kernel/rtas_flash.c b/arch/powerpc/kernel/rtas_flash.c index 8329190312c1..c642f0132988 100644 --- a/arch/powerpc/kernel/rtas_flash.c +++ b/arch/powerpc/kernel/rtas_flash.c | |||
@@ -191,7 +191,7 @@ static void free_flash_list(struct flash_block_list *f) | |||
191 | 191 | ||
192 | static int rtas_flash_release(struct inode *inode, struct file *file) | 192 | static int rtas_flash_release(struct inode *inode, struct file *file) |
193 | { | 193 | { |
194 | struct proc_dir_entry *dp = PDE(file->f_path.dentry->d_inode); | 194 | struct proc_dir_entry *dp = PDE(file_inode(file)); |
195 | struct rtas_update_flash_t *uf; | 195 | struct rtas_update_flash_t *uf; |
196 | 196 | ||
197 | uf = (struct rtas_update_flash_t *) dp->data; | 197 | uf = (struct rtas_update_flash_t *) dp->data; |
@@ -253,7 +253,7 @@ static void get_flash_status_msg(int status, char *buf) | |||
253 | static ssize_t rtas_flash_read(struct file *file, char __user *buf, | 253 | static ssize_t rtas_flash_read(struct file *file, char __user *buf, |
254 | size_t count, loff_t *ppos) | 254 | size_t count, loff_t *ppos) |
255 | { | 255 | { |
256 | struct proc_dir_entry *dp = PDE(file->f_path.dentry->d_inode); | 256 | struct proc_dir_entry *dp = PDE(file_inode(file)); |
257 | struct rtas_update_flash_t *uf; | 257 | struct rtas_update_flash_t *uf; |
258 | char msg[RTAS_MSG_MAXLEN]; | 258 | char msg[RTAS_MSG_MAXLEN]; |
259 | 259 | ||
@@ -282,7 +282,7 @@ void rtas_block_ctor(void *ptr) | |||
282 | static ssize_t rtas_flash_write(struct file *file, const char __user *buffer, | 282 | static ssize_t rtas_flash_write(struct file *file, const char __user *buffer, |
283 | size_t count, loff_t *off) | 283 | size_t count, loff_t *off) |
284 | { | 284 | { |
285 | struct proc_dir_entry *dp = PDE(file->f_path.dentry->d_inode); | 285 | struct proc_dir_entry *dp = PDE(file_inode(file)); |
286 | struct rtas_update_flash_t *uf; | 286 | struct rtas_update_flash_t *uf; |
287 | char *p; | 287 | char *p; |
288 | int next_free; | 288 | int next_free; |
@@ -374,7 +374,7 @@ static void manage_flash(struct rtas_manage_flash_t *args_buf) | |||
374 | static ssize_t manage_flash_read(struct file *file, char __user *buf, | 374 | static ssize_t manage_flash_read(struct file *file, char __user *buf, |
375 | size_t count, loff_t *ppos) | 375 | size_t count, loff_t *ppos) |
376 | { | 376 | { |
377 | struct proc_dir_entry *dp = PDE(file->f_path.dentry->d_inode); | 377 | struct proc_dir_entry *dp = PDE(file_inode(file)); |
378 | struct rtas_manage_flash_t *args_buf; | 378 | struct rtas_manage_flash_t *args_buf; |
379 | char msg[RTAS_MSG_MAXLEN]; | 379 | char msg[RTAS_MSG_MAXLEN]; |
380 | int msglen; | 380 | int msglen; |
@@ -391,7 +391,7 @@ static ssize_t manage_flash_read(struct file *file, char __user *buf, | |||
391 | static ssize_t manage_flash_write(struct file *file, const char __user *buf, | 391 | static ssize_t manage_flash_write(struct file *file, const char __user *buf, |
392 | size_t count, loff_t *off) | 392 | size_t count, loff_t *off) |
393 | { | 393 | { |
394 | struct proc_dir_entry *dp = PDE(file->f_path.dentry->d_inode); | 394 | struct proc_dir_entry *dp = PDE(file_inode(file)); |
395 | struct rtas_manage_flash_t *args_buf; | 395 | struct rtas_manage_flash_t *args_buf; |
396 | const char reject_str[] = "0"; | 396 | const char reject_str[] = "0"; |
397 | const char commit_str[] = "1"; | 397 | const char commit_str[] = "1"; |
@@ -462,7 +462,7 @@ static int get_validate_flash_msg(struct rtas_validate_flash_t *args_buf, | |||
462 | static ssize_t validate_flash_read(struct file *file, char __user *buf, | 462 | static ssize_t validate_flash_read(struct file *file, char __user *buf, |
463 | size_t count, loff_t *ppos) | 463 | size_t count, loff_t *ppos) |
464 | { | 464 | { |
465 | struct proc_dir_entry *dp = PDE(file->f_path.dentry->d_inode); | 465 | struct proc_dir_entry *dp = PDE(file_inode(file)); |
466 | struct rtas_validate_flash_t *args_buf; | 466 | struct rtas_validate_flash_t *args_buf; |
467 | char msg[RTAS_MSG_MAXLEN]; | 467 | char msg[RTAS_MSG_MAXLEN]; |
468 | int msglen; | 468 | int msglen; |
@@ -477,7 +477,7 @@ static ssize_t validate_flash_read(struct file *file, char __user *buf, | |||
477 | static ssize_t validate_flash_write(struct file *file, const char __user *buf, | 477 | static ssize_t validate_flash_write(struct file *file, const char __user *buf, |
478 | size_t count, loff_t *off) | 478 | size_t count, loff_t *off) |
479 | { | 479 | { |
480 | struct proc_dir_entry *dp = PDE(file->f_path.dentry->d_inode); | 480 | struct proc_dir_entry *dp = PDE(file_inode(file)); |
481 | struct rtas_validate_flash_t *args_buf; | 481 | struct rtas_validate_flash_t *args_buf; |
482 | int rc; | 482 | int rc; |
483 | 483 | ||
@@ -526,7 +526,7 @@ done: | |||
526 | 526 | ||
527 | static int validate_flash_release(struct inode *inode, struct file *file) | 527 | static int validate_flash_release(struct inode *inode, struct file *file) |
528 | { | 528 | { |
529 | struct proc_dir_entry *dp = PDE(file->f_path.dentry->d_inode); | 529 | struct proc_dir_entry *dp = PDE(file_inode(file)); |
530 | struct rtas_validate_flash_t *args_buf; | 530 | struct rtas_validate_flash_t *args_buf; |
531 | 531 | ||
532 | args_buf = (struct rtas_validate_flash_t *) dp->data; | 532 | args_buf = (struct rtas_validate_flash_t *) dp->data; |
diff --git a/arch/powerpc/platforms/cell/spufs/coredump.c b/arch/powerpc/platforms/cell/spufs/coredump.c index 657e3f233a64..c9500ea7be2f 100644 --- a/arch/powerpc/platforms/cell/spufs/coredump.c +++ b/arch/powerpc/platforms/cell/spufs/coredump.c | |||
@@ -111,7 +111,7 @@ static int match_context(const void *v, struct file *file, unsigned fd) | |||
111 | struct spu_context *ctx; | 111 | struct spu_context *ctx; |
112 | if (file->f_op != &spufs_context_fops) | 112 | if (file->f_op != &spufs_context_fops) |
113 | return 0; | 113 | return 0; |
114 | ctx = SPUFS_I(file->f_dentry->d_inode)->i_ctx; | 114 | ctx = SPUFS_I(file_inode(file))->i_ctx; |
115 | if (ctx->flags & SPU_CREATE_NOSCHED) | 115 | if (ctx->flags & SPU_CREATE_NOSCHED) |
116 | return 0; | 116 | return 0; |
117 | return fd + 1; | 117 | return fd + 1; |
@@ -137,7 +137,7 @@ static struct spu_context *coredump_next_context(int *fd) | |||
137 | return NULL; | 137 | return NULL; |
138 | *fd = n - 1; | 138 | *fd = n - 1; |
139 | file = fcheck(*fd); | 139 | file = fcheck(*fd); |
140 | return SPUFS_I(file->f_dentry->d_inode)->i_ctx; | 140 | return SPUFS_I(file_inode(file))->i_ctx; |
141 | } | 141 | } |
142 | 142 | ||
143 | int spufs_coredump_extra_notes_size(void) | 143 | int spufs_coredump_extra_notes_size(void) |
diff --git a/arch/powerpc/platforms/cell/spufs/file.c b/arch/powerpc/platforms/cell/spufs/file.c index 0cfece4cf6ef..68c57d38745a 100644 --- a/arch/powerpc/platforms/cell/spufs/file.c +++ b/arch/powerpc/platforms/cell/spufs/file.c | |||
@@ -1852,7 +1852,7 @@ out: | |||
1852 | 1852 | ||
1853 | static int spufs_mfc_fsync(struct file *file, loff_t start, loff_t end, int datasync) | 1853 | static int spufs_mfc_fsync(struct file *file, loff_t start, loff_t end, int datasync) |
1854 | { | 1854 | { |
1855 | struct inode *inode = file->f_path.dentry->d_inode; | 1855 | struct inode *inode = file_inode(file); |
1856 | int err = filemap_write_and_wait_range(inode->i_mapping, start, end); | 1856 | int err = filemap_write_and_wait_range(inode->i_mapping, start, end); |
1857 | if (!err) { | 1857 | if (!err) { |
1858 | mutex_lock(&inode->i_mutex); | 1858 | mutex_lock(&inode->i_mutex); |
@@ -2501,7 +2501,7 @@ static int switch_log_sprint(struct spu_context *ctx, char *tbuf, int n) | |||
2501 | static ssize_t spufs_switch_log_read(struct file *file, char __user *buf, | 2501 | static ssize_t spufs_switch_log_read(struct file *file, char __user *buf, |
2502 | size_t len, loff_t *ppos) | 2502 | size_t len, loff_t *ppos) |
2503 | { | 2503 | { |
2504 | struct inode *inode = file->f_path.dentry->d_inode; | 2504 | struct inode *inode = file_inode(file); |
2505 | struct spu_context *ctx = SPUFS_I(inode)->i_ctx; | 2505 | struct spu_context *ctx = SPUFS_I(inode)->i_ctx; |
2506 | int error = 0, cnt = 0; | 2506 | int error = 0, cnt = 0; |
2507 | 2507 | ||
@@ -2571,7 +2571,7 @@ static ssize_t spufs_switch_log_read(struct file *file, char __user *buf, | |||
2571 | 2571 | ||
2572 | static unsigned int spufs_switch_log_poll(struct file *file, poll_table *wait) | 2572 | static unsigned int spufs_switch_log_poll(struct file *file, poll_table *wait) |
2573 | { | 2573 | { |
2574 | struct inode *inode = file->f_path.dentry->d_inode; | 2574 | struct inode *inode = file_inode(file); |
2575 | struct spu_context *ctx = SPUFS_I(inode)->i_ctx; | 2575 | struct spu_context *ctx = SPUFS_I(inode)->i_ctx; |
2576 | unsigned int mask = 0; | 2576 | unsigned int mask = 0; |
2577 | int rc; | 2577 | int rc; |
diff --git a/arch/powerpc/platforms/cell/spufs/inode.c b/arch/powerpc/platforms/cell/spufs/inode.c index dba1ce235da5..99db6161e5c9 100644 --- a/arch/powerpc/platforms/cell/spufs/inode.c +++ b/arch/powerpc/platforms/cell/spufs/inode.c | |||
@@ -368,7 +368,7 @@ spufs_assert_affinity(unsigned int flags, struct spu_gang *gang, | |||
368 | return ERR_PTR(-EINVAL); | 368 | return ERR_PTR(-EINVAL); |
369 | 369 | ||
370 | neighbor = get_spu_context( | 370 | neighbor = get_spu_context( |
371 | SPUFS_I(filp->f_dentry->d_inode)->i_ctx); | 371 | SPUFS_I(file_inode(filp))->i_ctx); |
372 | 372 | ||
373 | if (!list_empty(&neighbor->aff_list) && !(neighbor->aff_head) && | 373 | if (!list_empty(&neighbor->aff_list) && !(neighbor->aff_head) && |
374 | !list_is_last(&neighbor->aff_list, &gang->aff_list_head) && | 374 | !list_is_last(&neighbor->aff_list, &gang->aff_list_head) && |
diff --git a/arch/powerpc/platforms/cell/spufs/syscalls.c b/arch/powerpc/platforms/cell/spufs/syscalls.c index baee994fe810..b045fdda4845 100644 --- a/arch/powerpc/platforms/cell/spufs/syscalls.c +++ b/arch/powerpc/platforms/cell/spufs/syscalls.c | |||
@@ -47,7 +47,7 @@ static long do_spu_run(struct file *filp, | |||
47 | if (filp->f_op != &spufs_context_fops) | 47 | if (filp->f_op != &spufs_context_fops) |
48 | goto out; | 48 | goto out; |
49 | 49 | ||
50 | i = SPUFS_I(filp->f_path.dentry->d_inode); | 50 | i = SPUFS_I(file_inode(filp)); |
51 | ret = spufs_run_spu(i->i_ctx, &npc, &status); | 51 | ret = spufs_run_spu(i->i_ctx, &npc, &status); |
52 | 52 | ||
53 | if (put_user(npc, unpc)) | 53 | if (put_user(npc, unpc)) |
diff --git a/arch/powerpc/platforms/pseries/hvCall_inst.c b/arch/powerpc/platforms/pseries/hvCall_inst.c index c9311cfdfcac..cf4e7736e4f1 100644 --- a/arch/powerpc/platforms/pseries/hvCall_inst.c +++ b/arch/powerpc/platforms/pseries/hvCall_inst.c | |||
@@ -86,7 +86,7 @@ static int hcall_inst_seq_open(struct inode *inode, struct file *file) | |||
86 | 86 | ||
87 | rc = seq_open(file, &hcall_inst_seq_ops); | 87 | rc = seq_open(file, &hcall_inst_seq_ops); |
88 | seq = file->private_data; | 88 | seq = file->private_data; |
89 | seq->private = file->f_path.dentry->d_inode->i_private; | 89 | seq->private = file_inode(file)->i_private; |
90 | 90 | ||
91 | return rc; | 91 | return rc; |
92 | } | 92 | } |
diff --git a/arch/powerpc/platforms/pseries/scanlog.c b/arch/powerpc/platforms/pseries/scanlog.c index 554457294a2b..47f3cda2a68b 100644 --- a/arch/powerpc/platforms/pseries/scanlog.c +++ b/arch/powerpc/platforms/pseries/scanlog.c | |||
@@ -46,16 +46,12 @@ static struct proc_dir_entry *proc_ppc64_scan_log_dump; /* The proc file */ | |||
46 | static ssize_t scanlog_read(struct file *file, char __user *buf, | 46 | static ssize_t scanlog_read(struct file *file, char __user *buf, |
47 | size_t count, loff_t *ppos) | 47 | size_t count, loff_t *ppos) |
48 | { | 48 | { |
49 | struct inode * inode = file->f_path.dentry->d_inode; | 49 | struct proc_dir_entry *dp = PDE(file_inode(file)); |
50 | struct proc_dir_entry *dp; | 50 | unsigned int *data = (unsigned int *)dp->data; |
51 | unsigned int *data; | ||
52 | int status; | 51 | int status; |
53 | unsigned long len, off; | 52 | unsigned long len, off; |
54 | unsigned int wait_time; | 53 | unsigned int wait_time; |
55 | 54 | ||
56 | dp = PDE(inode); | ||
57 | data = (unsigned int *)dp->data; | ||
58 | |||
59 | if (count > RTAS_DATA_BUF_SIZE) | 55 | if (count > RTAS_DATA_BUF_SIZE) |
60 | count = RTAS_DATA_BUF_SIZE; | 56 | count = RTAS_DATA_BUF_SIZE; |
61 | 57 | ||