diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-05-01 20:51:54 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-05-01 20:51:54 -0400 |
commit | 20b4fb485227404329e41ad15588afad3df23050 (patch) | |
tree | f3e099f0ab3da8a93b447203e294d2bb22f6dc05 /arch/arm | |
parent | b9394d8a657cd3c064fa432aa0905c1b58b38fe9 (diff) | |
parent | ac3e3c5b1164397656df81b9e9ab4991184d3236 (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull VFS updates from Al Viro,
Misc cleanups all over the place, mainly wrt /proc interfaces (switch
create_proc_entry to proc_create(), get rid of the deprecated
create_proc_read_entry() in favor of using proc_create_data() and
seq_file etc).
7kloc removed.
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (204 commits)
don't bother with deferred freeing of fdtables
proc: Move non-public stuff from linux/proc_fs.h to fs/proc/internal.h
proc: Make the PROC_I() and PDE() macros internal to procfs
proc: Supply a function to remove a proc entry by PDE
take cgroup_open() and cpuset_open() to fs/proc/base.c
ppc: Clean up scanlog
ppc: Clean up rtas_flash driver somewhat
hostap: proc: Use remove_proc_subtree()
drm: proc: Use remove_proc_subtree()
drm: proc: Use minor->index to label things, not PDE->name
drm: Constify drm_proc_list[]
zoran: Don't print proc_dir_entry data in debug
reiserfs: Don't access the proc_dir_entry in r_open(), r_start() r_show()
proc: Supply an accessor for getting the data from a PDE's parent
airo: Use remove_proc_subtree()
rtl8192u: Don't need to save device proc dir PDE
rtl8187se: Use a dir under /proc/net/r8180/
proc: Add proc_mkdir_data()
proc: Move some bits from linux/proc_fs.h to linux/{of.h,signal.h,tty.h}
proc: Move PDE_NET() to fs/proc/proc_net.c
...
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/kernel/atags_proc.c | 28 | ||||
-rw-r--r-- | arch/arm/kernel/swp_emulate.c | 43 | ||||
-rw-r--r-- | arch/arm/mach-msm/last_radio_log.c | 20 | ||||
-rw-r--r-- | arch/arm/mach-omap1/pm.c | 78 |
4 files changed, 70 insertions, 99 deletions
diff --git a/arch/arm/kernel/atags_proc.c b/arch/arm/kernel/atags_proc.c index 42a1a1415fa6..c7ff8073416f 100644 --- a/arch/arm/kernel/atags_proc.c +++ b/arch/arm/kernel/atags_proc.c | |||
@@ -9,24 +9,18 @@ struct buffer { | |||
9 | char data[]; | 9 | char data[]; |
10 | }; | 10 | }; |
11 | 11 | ||
12 | static int | 12 | static ssize_t atags_read(struct file *file, char __user *buf, |
13 | read_buffer(char* page, char** start, off_t off, int count, | 13 | size_t count, loff_t *ppos) |
14 | int* eof, void* data) | ||
15 | { | 14 | { |
16 | struct buffer *buffer = (struct buffer *)data; | 15 | struct buffer *b = PDE_DATA(file_inode(file)); |
17 | 16 | return simple_read_from_buffer(buf, count, ppos, b->data, b->size); | |
18 | if (off >= buffer->size) { | ||
19 | *eof = 1; | ||
20 | return 0; | ||
21 | } | ||
22 | |||
23 | count = min((int) (buffer->size - off), count); | ||
24 | |||
25 | memcpy(page, &buffer->data[off], count); | ||
26 | |||
27 | return count; | ||
28 | } | 17 | } |
29 | 18 | ||
19 | static const struct file_operations atags_fops = { | ||
20 | .read = atags_read, | ||
21 | .llseek = default_llseek, | ||
22 | }; | ||
23 | |||
30 | #define BOOT_PARAMS_SIZE 1536 | 24 | #define BOOT_PARAMS_SIZE 1536 |
31 | static char __initdata atags_copy[BOOT_PARAMS_SIZE]; | 25 | static char __initdata atags_copy[BOOT_PARAMS_SIZE]; |
32 | 26 | ||
@@ -66,9 +60,7 @@ static int __init init_atags_procfs(void) | |||
66 | b->size = size; | 60 | b->size = size; |
67 | memcpy(b->data, atags_copy, size); | 61 | memcpy(b->data, atags_copy, size); |
68 | 62 | ||
69 | tags_entry = create_proc_read_entry("atags", 0400, | 63 | tags_entry = proc_create_data("atags", 0400, NULL, &atags_fops, b); |
70 | NULL, read_buffer, b); | ||
71 | |||
72 | if (!tags_entry) | 64 | if (!tags_entry) |
73 | goto nomem; | 65 | goto nomem; |
74 | 66 | ||
diff --git a/arch/arm/kernel/swp_emulate.c b/arch/arm/kernel/swp_emulate.c index ab1017bd1667..087fc321e9e5 100644 --- a/arch/arm/kernel/swp_emulate.c +++ b/arch/arm/kernel/swp_emulate.c | |||
@@ -21,6 +21,7 @@ | |||
21 | #include <linux/init.h> | 21 | #include <linux/init.h> |
22 | #include <linux/kernel.h> | 22 | #include <linux/kernel.h> |
23 | #include <linux/proc_fs.h> | 23 | #include <linux/proc_fs.h> |
24 | #include <linux/seq_file.h> | ||
24 | #include <linux/sched.h> | 25 | #include <linux/sched.h> |
25 | #include <linux/syscalls.h> | 26 | #include <linux/syscalls.h> |
26 | #include <linux/perf_event.h> | 27 | #include <linux/perf_event.h> |
@@ -79,27 +80,27 @@ static unsigned long abtcounter; | |||
79 | static pid_t previous_pid; | 80 | static pid_t previous_pid; |
80 | 81 | ||
81 | #ifdef CONFIG_PROC_FS | 82 | #ifdef CONFIG_PROC_FS |
82 | static int proc_read_status(char *page, char **start, off_t off, int count, | 83 | static int proc_status_show(struct seq_file *m, void *v) |
83 | int *eof, void *data) | ||
84 | { | 84 | { |
85 | char *p = page; | 85 | seq_printf(m, "Emulated SWP:\t\t%lu\n", swpcounter); |
86 | int len; | 86 | seq_printf(m, "Emulated SWPB:\t\t%lu\n", swpbcounter); |
87 | 87 | seq_printf(m, "Aborted SWP{B}:\t\t%lu\n", abtcounter); | |
88 | p += sprintf(p, "Emulated SWP:\t\t%lu\n", swpcounter); | ||
89 | p += sprintf(p, "Emulated SWPB:\t\t%lu\n", swpbcounter); | ||
90 | p += sprintf(p, "Aborted SWP{B}:\t\t%lu\n", abtcounter); | ||
91 | if (previous_pid != 0) | 88 | if (previous_pid != 0) |
92 | p += sprintf(p, "Last process:\t\t%d\n", previous_pid); | 89 | seq_printf(m, "Last process:\t\t%d\n", previous_pid); |
93 | 90 | return 0; | |
94 | len = (p - page) - off; | 91 | } |
95 | if (len < 0) | ||
96 | len = 0; | ||
97 | |||
98 | *eof = (len <= count) ? 1 : 0; | ||
99 | *start = page + off; | ||
100 | 92 | ||
101 | return len; | 93 | static int proc_status_open(struct inode *inode, struct file *file) |
94 | { | ||
95 | return single_open(file, proc_status_show, PDE_DATA(inode)); | ||
102 | } | 96 | } |
97 | |||
98 | static const struct file_operations proc_status_fops = { | ||
99 | .open = proc_status_open, | ||
100 | .read = seq_read, | ||
101 | .llseek = seq_lseek, | ||
102 | .release = seq_release, | ||
103 | }; | ||
103 | #endif | 104 | #endif |
104 | 105 | ||
105 | /* | 106 | /* |
@@ -266,14 +267,8 @@ static struct undef_hook swp_hook = { | |||
266 | static int __init swp_emulation_init(void) | 267 | static int __init swp_emulation_init(void) |
267 | { | 268 | { |
268 | #ifdef CONFIG_PROC_FS | 269 | #ifdef CONFIG_PROC_FS |
269 | struct proc_dir_entry *res; | 270 | if (!proc_create("cpu/swp_emulation", S_IRUGO, NULL, &proc_status_fops)) |
270 | |||
271 | res = create_proc_entry("cpu/swp_emulation", S_IRUGO, NULL); | ||
272 | |||
273 | if (!res) | ||
274 | return -ENOMEM; | 271 | return -ENOMEM; |
275 | |||
276 | res->read_proc = proc_read_status; | ||
277 | #endif /* CONFIG_PROC_FS */ | 272 | #endif /* CONFIG_PROC_FS */ |
278 | 273 | ||
279 | printk(KERN_NOTICE "Registering SWP/SWPB emulation handler\n"); | 274 | printk(KERN_NOTICE "Registering SWP/SWPB emulation handler\n"); |
diff --git a/arch/arm/mach-msm/last_radio_log.c b/arch/arm/mach-msm/last_radio_log.c index 1e243f46a969..7777767ee89a 100644 --- a/arch/arm/mach-msm/last_radio_log.c +++ b/arch/arm/mach-msm/last_radio_log.c | |||
@@ -31,20 +31,8 @@ extern void *smem_item(unsigned id, unsigned *size); | |||
31 | static ssize_t last_radio_log_read(struct file *file, char __user *buf, | 31 | static ssize_t last_radio_log_read(struct file *file, char __user *buf, |
32 | size_t len, loff_t *offset) | 32 | size_t len, loff_t *offset) |
33 | { | 33 | { |
34 | loff_t pos = *offset; | 34 | return simple_read_from_buffer(buf, len, offset, |
35 | ssize_t count; | 35 | radio_log_base, radio_log_size); |
36 | |||
37 | if (pos >= radio_log_size) | ||
38 | return 0; | ||
39 | |||
40 | count = min(len, (size_t)(radio_log_size - pos)); | ||
41 | if (copy_to_user(buf, radio_log_base + pos, count)) { | ||
42 | pr_err("%s: copy to user failed\n", __func__); | ||
43 | return -EFAULT; | ||
44 | } | ||
45 | |||
46 | *offset += count; | ||
47 | return count; | ||
48 | } | 36 | } |
49 | 37 | ||
50 | static struct file_operations last_radio_log_fops = { | 38 | static struct file_operations last_radio_log_fops = { |
@@ -67,7 +55,8 @@ void msm_init_last_radio_log(struct module *owner) | |||
67 | return; | 55 | return; |
68 | } | 56 | } |
69 | 57 | ||
70 | entry = create_proc_entry("last_radio_log", S_IFREG | S_IRUGO, NULL); | 58 | entry = proc_create("last_radio_log", S_IRUGO, NULL, |
59 | &last_radio_log_fops); | ||
71 | if (!entry) { | 60 | if (!entry) { |
72 | pr_err("%s: could not create proc entry for radio log\n", | 61 | pr_err("%s: could not create proc entry for radio log\n", |
73 | __func__); | 62 | __func__); |
@@ -77,7 +66,6 @@ void msm_init_last_radio_log(struct module *owner) | |||
77 | pr_err("%s: last radio log is %d bytes long\n", __func__, | 66 | pr_err("%s: last radio log is %d bytes long\n", __func__, |
78 | radio_log_size); | 67 | radio_log_size); |
79 | last_radio_log_fops.owner = owner; | 68 | last_radio_log_fops.owner = owner; |
80 | entry->proc_fops = &last_radio_log_fops; | ||
81 | entry->size = radio_log_size; | 69 | entry->size = radio_log_size; |
82 | } | 70 | } |
83 | EXPORT_SYMBOL(msm_init_last_radio_log); | 71 | EXPORT_SYMBOL(msm_init_last_radio_log); |
diff --git a/arch/arm/mach-omap1/pm.c b/arch/arm/mach-omap1/pm.c index db37f49da5ac..dd712f109738 100644 --- a/arch/arm/mach-omap1/pm.c +++ b/arch/arm/mach-omap1/pm.c | |||
@@ -37,7 +37,8 @@ | |||
37 | 37 | ||
38 | #include <linux/suspend.h> | 38 | #include <linux/suspend.h> |
39 | #include <linux/sched.h> | 39 | #include <linux/sched.h> |
40 | #include <linux/proc_fs.h> | 40 | #include <linux/debugfs.h> |
41 | #include <linux/seq_file.h> | ||
41 | #include <linux/interrupt.h> | 42 | #include <linux/interrupt.h> |
42 | #include <linux/sysfs.h> | 43 | #include <linux/sysfs.h> |
43 | #include <linux/module.h> | 44 | #include <linux/module.h> |
@@ -423,23 +424,12 @@ void omap1_pm_suspend(void) | |||
423 | omap_rev()); | 424 | omap_rev()); |
424 | } | 425 | } |
425 | 426 | ||
426 | #if defined(DEBUG) && defined(CONFIG_PROC_FS) | 427 | #ifdef CONFIG_DEBUG_FS |
427 | static int g_read_completed; | ||
428 | |||
429 | /* | 428 | /* |
430 | * Read system PM registers for debugging | 429 | * Read system PM registers for debugging |
431 | */ | 430 | */ |
432 | static int omap_pm_read_proc( | 431 | static int omap_pm_debug_show(struct seq_file *m, void *v) |
433 | char *page_buffer, | ||
434 | char **my_first_byte, | ||
435 | off_t virtual_start, | ||
436 | int length, | ||
437 | int *eof, | ||
438 | void *data) | ||
439 | { | 432 | { |
440 | int my_buffer_offset = 0; | ||
441 | char * const my_base = page_buffer; | ||
442 | |||
443 | ARM_SAVE(ARM_CKCTL); | 433 | ARM_SAVE(ARM_CKCTL); |
444 | ARM_SAVE(ARM_IDLECT1); | 434 | ARM_SAVE(ARM_IDLECT1); |
445 | ARM_SAVE(ARM_IDLECT2); | 435 | ARM_SAVE(ARM_IDLECT2); |
@@ -480,10 +470,7 @@ static int omap_pm_read_proc( | |||
480 | MPUI1610_SAVE(EMIFS_CONFIG); | 470 | MPUI1610_SAVE(EMIFS_CONFIG); |
481 | } | 471 | } |
482 | 472 | ||
483 | if (virtual_start == 0) { | 473 | seq_printf(m, |
484 | g_read_completed = 0; | ||
485 | |||
486 | my_buffer_offset += sprintf(my_base + my_buffer_offset, | ||
487 | "ARM_CKCTL_REG: 0x%-8x \n" | 474 | "ARM_CKCTL_REG: 0x%-8x \n" |
488 | "ARM_IDLECT1_REG: 0x%-8x \n" | 475 | "ARM_IDLECT1_REG: 0x%-8x \n" |
489 | "ARM_IDLECT2_REG: 0x%-8x \n" | 476 | "ARM_IDLECT2_REG: 0x%-8x \n" |
@@ -513,8 +500,8 @@ static int omap_pm_read_proc( | |||
513 | ULPD_SHOW(ULPD_STATUS_REQ), | 500 | ULPD_SHOW(ULPD_STATUS_REQ), |
514 | ULPD_SHOW(ULPD_POWER_CTRL)); | 501 | ULPD_SHOW(ULPD_POWER_CTRL)); |
515 | 502 | ||
516 | if (cpu_is_omap7xx()) { | 503 | if (cpu_is_omap7xx()) { |
517 | my_buffer_offset += sprintf(my_base + my_buffer_offset, | 504 | seq_printf(m, |
518 | "MPUI7XX_CTRL_REG 0x%-8x \n" | 505 | "MPUI7XX_CTRL_REG 0x%-8x \n" |
519 | "MPUI7XX_DSP_STATUS_REG: 0x%-8x \n" | 506 | "MPUI7XX_DSP_STATUS_REG: 0x%-8x \n" |
520 | "MPUI7XX_DSP_BOOT_CONFIG_REG: 0x%-8x \n" | 507 | "MPUI7XX_DSP_BOOT_CONFIG_REG: 0x%-8x \n" |
@@ -527,8 +514,8 @@ static int omap_pm_read_proc( | |||
527 | MPUI7XX_SHOW(MPUI_DSP_API_CONFIG), | 514 | MPUI7XX_SHOW(MPUI_DSP_API_CONFIG), |
528 | MPUI7XX_SHOW(EMIFF_SDRAM_CONFIG), | 515 | MPUI7XX_SHOW(EMIFF_SDRAM_CONFIG), |
529 | MPUI7XX_SHOW(EMIFS_CONFIG)); | 516 | MPUI7XX_SHOW(EMIFS_CONFIG)); |
530 | } else if (cpu_is_omap15xx()) { | 517 | } else if (cpu_is_omap15xx()) { |
531 | my_buffer_offset += sprintf(my_base + my_buffer_offset, | 518 | seq_printf(m, |
532 | "MPUI1510_CTRL_REG 0x%-8x \n" | 519 | "MPUI1510_CTRL_REG 0x%-8x \n" |
533 | "MPUI1510_DSP_STATUS_REG: 0x%-8x \n" | 520 | "MPUI1510_DSP_STATUS_REG: 0x%-8x \n" |
534 | "MPUI1510_DSP_BOOT_CONFIG_REG: 0x%-8x \n" | 521 | "MPUI1510_DSP_BOOT_CONFIG_REG: 0x%-8x \n" |
@@ -541,8 +528,8 @@ static int omap_pm_read_proc( | |||
541 | MPUI1510_SHOW(MPUI_DSP_API_CONFIG), | 528 | MPUI1510_SHOW(MPUI_DSP_API_CONFIG), |
542 | MPUI1510_SHOW(EMIFF_SDRAM_CONFIG), | 529 | MPUI1510_SHOW(EMIFF_SDRAM_CONFIG), |
543 | MPUI1510_SHOW(EMIFS_CONFIG)); | 530 | MPUI1510_SHOW(EMIFS_CONFIG)); |
544 | } else if (cpu_is_omap16xx()) { | 531 | } else if (cpu_is_omap16xx()) { |
545 | my_buffer_offset += sprintf(my_base + my_buffer_offset, | 532 | seq_printf(m, |
546 | "MPUI1610_CTRL_REG 0x%-8x \n" | 533 | "MPUI1610_CTRL_REG 0x%-8x \n" |
547 | "MPUI1610_DSP_STATUS_REG: 0x%-8x \n" | 534 | "MPUI1610_DSP_STATUS_REG: 0x%-8x \n" |
548 | "MPUI1610_DSP_BOOT_CONFIG_REG: 0x%-8x \n" | 535 | "MPUI1610_DSP_BOOT_CONFIG_REG: 0x%-8x \n" |
@@ -555,28 +542,37 @@ static int omap_pm_read_proc( | |||
555 | MPUI1610_SHOW(MPUI_DSP_API_CONFIG), | 542 | MPUI1610_SHOW(MPUI_DSP_API_CONFIG), |
556 | MPUI1610_SHOW(EMIFF_SDRAM_CONFIG), | 543 | MPUI1610_SHOW(EMIFF_SDRAM_CONFIG), |
557 | MPUI1610_SHOW(EMIFS_CONFIG)); | 544 | MPUI1610_SHOW(EMIFS_CONFIG)); |
558 | } | ||
559 | |||
560 | g_read_completed++; | ||
561 | } else if (g_read_completed >= 1) { | ||
562 | *eof = 1; | ||
563 | return 0; | ||
564 | } | 545 | } |
565 | g_read_completed++; | ||
566 | 546 | ||
567 | *my_first_byte = page_buffer; | 547 | return 0; |
568 | return my_buffer_offset; | 548 | } |
549 | |||
550 | static int omap_pm_debug_open(struct inode *inode, struct file *file) | ||
551 | { | ||
552 | return single_open(file, omap_pm_debug_show, | ||
553 | &inode->i_private); | ||
569 | } | 554 | } |
570 | 555 | ||
571 | static void omap_pm_init_proc(void) | 556 | static const struct file_operations omap_pm_debug_fops = { |
557 | .open = omap_pm_debug_open, | ||
558 | .read = seq_read, | ||
559 | .llseek = seq_lseek, | ||
560 | .release = seq_release, | ||
561 | }; | ||
562 | |||
563 | static void omap_pm_init_debugfs(void) | ||
572 | { | 564 | { |
573 | /* XXX Appears to leak memory */ | 565 | struct dentry *d; |
574 | create_proc_read_entry("driver/omap_pm", | 566 | |
575 | S_IWUSR | S_IRUGO, NULL, | 567 | d = debugfs_create_dir("pm_debug", NULL); |
576 | omap_pm_read_proc, NULL); | 568 | if (!d) |
569 | return; | ||
570 | |||
571 | (void) debugfs_create_file("omap_pm", S_IWUSR | S_IRUGO, | ||
572 | d, NULL, &omap_pm_debug_fops); | ||
577 | } | 573 | } |
578 | 574 | ||
579 | #endif /* DEBUG && CONFIG_PROC_FS */ | 575 | #endif /* CONFIG_DEBUG_FS */ |
580 | 576 | ||
581 | /* | 577 | /* |
582 | * omap_pm_prepare - Do preliminary suspend work. | 578 | * omap_pm_prepare - Do preliminary suspend work. |
@@ -701,8 +697,8 @@ static int __init omap_pm_init(void) | |||
701 | 697 | ||
702 | suspend_set_ops(&omap_pm_ops); | 698 | suspend_set_ops(&omap_pm_ops); |
703 | 699 | ||
704 | #if defined(DEBUG) && defined(CONFIG_PROC_FS) | 700 | #ifdef CONFIG_DEBUG_FS |
705 | omap_pm_init_proc(); | 701 | omap_pm_init_debugfs(); |
706 | #endif | 702 | #endif |
707 | 703 | ||
708 | #ifdef CONFIG_OMAP_32K_TIMER | 704 | #ifdef CONFIG_OMAP_32K_TIMER |