aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexey Dobriyan <adobriyan@gmail.com>2008-11-09 17:32:52 -0500
committerAlexey Dobriyan <adobriyan@gmail.com>2009-01-05 04:27:44 -0500
commit631f9c1868b970197747c80fc5168ad7d9fd5d53 (patch)
treeba6dd234710698070aa4aa83d105cef771a901a1
parentecae934edc0c29ec7405da18855004c317de26c6 (diff)
proc: remove '##' usage
Inability to jump to /proc/*/foo handlers with ctags is annoying. Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
-rw-r--r--fs/proc/base.c183
1 files changed, 90 insertions, 93 deletions
diff --git a/fs/proc/base.c b/fs/proc/base.c
index 8642623ea798..ce7a6da1b6a0 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -109,25 +109,22 @@ struct pid_entry {
109 .op = OP, \ 109 .op = OP, \
110} 110}
111 111
112#define DIR(NAME, MODE, OTYPE) \ 112#define DIR(NAME, MODE, iops, fops) \
113 NOD(NAME, (S_IFDIR|(MODE)), \ 113 NOD(NAME, (S_IFDIR|(MODE)), &iops, &fops, {} )
114 &proc_##OTYPE##_inode_operations, &proc_##OTYPE##_operations, \ 114#define LNK(NAME, get_link) \
115 {} )
116#define LNK(NAME, OTYPE) \
117 NOD(NAME, (S_IFLNK|S_IRWXUGO), \ 115 NOD(NAME, (S_IFLNK|S_IRWXUGO), \
118 &proc_pid_link_inode_operations, NULL, \ 116 &proc_pid_link_inode_operations, NULL, \
119 { .proc_get_link = &proc_##OTYPE##_link } ) 117 { .proc_get_link = get_link } )
120#define REG(NAME, MODE, OTYPE) \ 118#define REG(NAME, MODE, fops) \
121 NOD(NAME, (S_IFREG|(MODE)), NULL, \ 119 NOD(NAME, (S_IFREG|(MODE)), NULL, &fops, {})
122 &proc_##OTYPE##_operations, {}) 120#define INF(NAME, MODE, read) \
123#define INF(NAME, MODE, OTYPE) \
124 NOD(NAME, (S_IFREG|(MODE)), \ 121 NOD(NAME, (S_IFREG|(MODE)), \
125 NULL, &proc_info_file_operations, \ 122 NULL, &proc_info_file_operations, \
126 { .proc_read = &proc_##OTYPE } ) 123 { .proc_read = read } )
127#define ONE(NAME, MODE, OTYPE) \ 124#define ONE(NAME, MODE, show) \
128 NOD(NAME, (S_IFREG|(MODE)), \ 125 NOD(NAME, (S_IFREG|(MODE)), \
129 NULL, &proc_single_file_operations, \ 126 NULL, &proc_single_file_operations, \
130 { .proc_show = &proc_##OTYPE } ) 127 { .proc_show = show } )
131 128
132/* 129/*
133 * Count the number of hardlinks for the pid_entry table, excluding the . 130 * Count the number of hardlinks for the pid_entry table, excluding the .
@@ -2134,12 +2131,12 @@ static const struct file_operations proc_pid_attr_operations = {
2134}; 2131};
2135 2132
2136static const struct pid_entry attr_dir_stuff[] = { 2133static const struct pid_entry attr_dir_stuff[] = {
2137 REG("current", S_IRUGO|S_IWUGO, pid_attr), 2134 REG("current", S_IRUGO|S_IWUGO, proc_pid_attr_operations),
2138 REG("prev", S_IRUGO, pid_attr), 2135 REG("prev", S_IRUGO, proc_pid_attr_operations),
2139 REG("exec", S_IRUGO|S_IWUGO, pid_attr), 2136 REG("exec", S_IRUGO|S_IWUGO, proc_pid_attr_operations),
2140 REG("fscreate", S_IRUGO|S_IWUGO, pid_attr), 2137 REG("fscreate", S_IRUGO|S_IWUGO, proc_pid_attr_operations),
2141 REG("keycreate", S_IRUGO|S_IWUGO, pid_attr), 2138 REG("keycreate", S_IRUGO|S_IWUGO, proc_pid_attr_operations),
2142 REG("sockcreate", S_IRUGO|S_IWUGO, pid_attr), 2139 REG("sockcreate", S_IRUGO|S_IWUGO, proc_pid_attr_operations),
2143}; 2140};
2144 2141
2145static int proc_attr_dir_readdir(struct file * filp, 2142static int proc_attr_dir_readdir(struct file * filp,
@@ -2461,74 +2458,74 @@ static const struct file_operations proc_task_operations;
2461static const struct inode_operations proc_task_inode_operations; 2458static const struct inode_operations proc_task_inode_operations;
2462 2459
2463static const struct pid_entry tgid_base_stuff[] = { 2460static const struct pid_entry tgid_base_stuff[] = {
2464 DIR("task", S_IRUGO|S_IXUGO, task), 2461 DIR("task", S_IRUGO|S_IXUGO, proc_task_inode_operations, proc_task_operations),
2465 DIR("fd", S_IRUSR|S_IXUSR, fd), 2462 DIR("fd", S_IRUSR|S_IXUSR, proc_fd_inode_operations, proc_fd_operations),
2466 DIR("fdinfo", S_IRUSR|S_IXUSR, fdinfo), 2463 DIR("fdinfo", S_IRUSR|S_IXUSR, proc_fdinfo_inode_operations, proc_fdinfo_operations),
2467#ifdef CONFIG_NET 2464#ifdef CONFIG_NET
2468 DIR("net", S_IRUGO|S_IXUGO, net), 2465 DIR("net", S_IRUGO|S_IXUGO, proc_net_inode_operations, proc_net_operations),
2469#endif 2466#endif
2470 REG("environ", S_IRUSR, environ), 2467 REG("environ", S_IRUSR, proc_environ_operations),
2471 INF("auxv", S_IRUSR, pid_auxv), 2468 INF("auxv", S_IRUSR, proc_pid_auxv),
2472 ONE("status", S_IRUGO, pid_status), 2469 ONE("status", S_IRUGO, proc_pid_status),
2473 ONE("personality", S_IRUSR, pid_personality), 2470 ONE("personality", S_IRUSR, proc_pid_personality),
2474 INF("limits", S_IRUSR, pid_limits), 2471 INF("limits", S_IRUSR, proc_pid_limits),
2475#ifdef CONFIG_SCHED_DEBUG 2472#ifdef CONFIG_SCHED_DEBUG
2476 REG("sched", S_IRUGO|S_IWUSR, pid_sched), 2473 REG("sched", S_IRUGO|S_IWUSR, proc_pid_sched_operations),
2477#endif 2474#endif
2478#ifdef CONFIG_HAVE_ARCH_TRACEHOOK 2475#ifdef CONFIG_HAVE_ARCH_TRACEHOOK
2479 INF("syscall", S_IRUSR, pid_syscall), 2476 INF("syscall", S_IRUSR, proc_pid_syscall),
2480#endif 2477#endif
2481 INF("cmdline", S_IRUGO, pid_cmdline), 2478 INF("cmdline", S_IRUGO, proc_pid_cmdline),
2482 ONE("stat", S_IRUGO, tgid_stat), 2479 ONE("stat", S_IRUGO, proc_tgid_stat),
2483 ONE("statm", S_IRUGO, pid_statm), 2480 ONE("statm", S_IRUGO, proc_pid_statm),
2484 REG("maps", S_IRUGO, maps), 2481 REG("maps", S_IRUGO, proc_maps_operations),
2485#ifdef CONFIG_NUMA 2482#ifdef CONFIG_NUMA
2486 REG("numa_maps", S_IRUGO, numa_maps), 2483 REG("numa_maps", S_IRUGO, proc_numa_maps_operations),
2487#endif 2484#endif
2488 REG("mem", S_IRUSR|S_IWUSR, mem), 2485 REG("mem", S_IRUSR|S_IWUSR, proc_mem_operations),
2489 LNK("cwd", cwd), 2486 LNK("cwd", proc_cwd_link),
2490 LNK("root", root), 2487 LNK("root", proc_root_link),
2491 LNK("exe", exe), 2488 LNK("exe", proc_exe_link),
2492 REG("mounts", S_IRUGO, mounts), 2489 REG("mounts", S_IRUGO, proc_mounts_operations),
2493 REG("mountinfo", S_IRUGO, mountinfo), 2490 REG("mountinfo", S_IRUGO, proc_mountinfo_operations),
2494 REG("mountstats", S_IRUSR, mountstats), 2491 REG("mountstats", S_IRUSR, proc_mountstats_operations),
2495#ifdef CONFIG_PROC_PAGE_MONITOR 2492#ifdef CONFIG_PROC_PAGE_MONITOR
2496 REG("clear_refs", S_IWUSR, clear_refs), 2493 REG("clear_refs", S_IWUSR, proc_clear_refs_operations),
2497 REG("smaps", S_IRUGO, smaps), 2494 REG("smaps", S_IRUGO, proc_smaps_operations),
2498 REG("pagemap", S_IRUSR, pagemap), 2495 REG("pagemap", S_IRUSR, proc_pagemap_operations),
2499#endif 2496#endif
2500#ifdef CONFIG_SECURITY 2497#ifdef CONFIG_SECURITY
2501 DIR("attr", S_IRUGO|S_IXUGO, attr_dir), 2498 DIR("attr", S_IRUGO|S_IXUGO, proc_attr_dir_inode_operations, proc_attr_dir_operations),
2502#endif 2499#endif
2503#ifdef CONFIG_KALLSYMS 2500#ifdef CONFIG_KALLSYMS
2504 INF("wchan", S_IRUGO, pid_wchan), 2501 INF("wchan", S_IRUGO, proc_pid_wchan),
2505#endif 2502#endif
2506#ifdef CONFIG_SCHEDSTATS 2503#ifdef CONFIG_SCHEDSTATS
2507 INF("schedstat", S_IRUGO, pid_schedstat), 2504 INF("schedstat", S_IRUGO, proc_pid_schedstat),
2508#endif 2505#endif
2509#ifdef CONFIG_LATENCYTOP 2506#ifdef CONFIG_LATENCYTOP
2510 REG("latency", S_IRUGO, lstats), 2507 REG("latency", S_IRUGO, proc_lstats_operations),
2511#endif 2508#endif
2512#ifdef CONFIG_PROC_PID_CPUSET 2509#ifdef CONFIG_PROC_PID_CPUSET
2513 REG("cpuset", S_IRUGO, cpuset), 2510 REG("cpuset", S_IRUGO, proc_cpuset_operations),
2514#endif 2511#endif
2515#ifdef CONFIG_CGROUPS 2512#ifdef CONFIG_CGROUPS
2516 REG("cgroup", S_IRUGO, cgroup), 2513 REG("cgroup", S_IRUGO, proc_cgroup_operations),
2517#endif 2514#endif
2518 INF("oom_score", S_IRUGO, oom_score), 2515 INF("oom_score", S_IRUGO, proc_oom_score),
2519 REG("oom_adj", S_IRUGO|S_IWUSR, oom_adjust), 2516 REG("oom_adj", S_IRUGO|S_IWUSR, proc_oom_adjust_operations),
2520#ifdef CONFIG_AUDITSYSCALL 2517#ifdef CONFIG_AUDITSYSCALL
2521 REG("loginuid", S_IWUSR|S_IRUGO, loginuid), 2518 REG("loginuid", S_IWUSR|S_IRUGO, proc_loginuid_operations),
2522 REG("sessionid", S_IRUGO, sessionid), 2519 REG("sessionid", S_IRUGO, proc_sessionid_operations),
2523#endif 2520#endif
2524#ifdef CONFIG_FAULT_INJECTION 2521#ifdef CONFIG_FAULT_INJECTION
2525 REG("make-it-fail", S_IRUGO|S_IWUSR, fault_inject), 2522 REG("make-it-fail", S_IRUGO|S_IWUSR, proc_fault_inject_operations),
2526#endif 2523#endif
2527#if defined(USE_ELF_CORE_DUMP) && defined(CONFIG_ELF_CORE) 2524#if defined(USE_ELF_CORE_DUMP) && defined(CONFIG_ELF_CORE)
2528 REG("coredump_filter", S_IRUGO|S_IWUSR, coredump_filter), 2525 REG("coredump_filter", S_IRUGO|S_IWUSR, proc_coredump_filter_operations),
2529#endif 2526#endif
2530#ifdef CONFIG_TASK_IO_ACCOUNTING 2527#ifdef CONFIG_TASK_IO_ACCOUNTING
2531 INF("io", S_IRUGO, tgid_io_accounting), 2528 INF("io", S_IRUGO, proc_tgid_io_accounting),
2532#endif 2529#endif
2533}; 2530};
2534 2531
@@ -2801,66 +2798,66 @@ out_no_task:
2801 * Tasks 2798 * Tasks
2802 */ 2799 */
2803static const struct pid_entry tid_base_stuff[] = { 2800static const struct pid_entry tid_base_stuff[] = {
2804 DIR("fd", S_IRUSR|S_IXUSR, fd), 2801 DIR("fd", S_IRUSR|S_IXUSR, proc_fd_inode_operations, proc_fd_operations),
2805 DIR("fdinfo", S_IRUSR|S_IXUSR, fdinfo), 2802 DIR("fdinfo", S_IRUSR|S_IXUSR, proc_fdinfo_inode_operations, proc_fd_operations),
2806 REG("environ", S_IRUSR, environ), 2803 REG("environ", S_IRUSR, proc_environ_operations),
2807 INF("auxv", S_IRUSR, pid_auxv), 2804 INF("auxv", S_IRUSR, proc_pid_auxv),
2808 ONE("status", S_IRUGO, pid_status), 2805 ONE("status", S_IRUGO, proc_pid_status),
2809 ONE("personality", S_IRUSR, pid_personality), 2806 ONE("personality", S_IRUSR, proc_pid_personality),
2810 INF("limits", S_IRUSR, pid_limits), 2807 INF("limits", S_IRUSR, proc_pid_limits),
2811#ifdef CONFIG_SCHED_DEBUG 2808#ifdef CONFIG_SCHED_DEBUG
2812 REG("sched", S_IRUGO|S_IWUSR, pid_sched), 2809 REG("sched", S_IRUGO|S_IWUSR, proc_pid_sched_operations),
2813#endif 2810#endif
2814#ifdef CONFIG_HAVE_ARCH_TRACEHOOK 2811#ifdef CONFIG_HAVE_ARCH_TRACEHOOK
2815 INF("syscall", S_IRUSR, pid_syscall), 2812 INF("syscall", S_IRUSR, proc_pid_syscall),
2816#endif 2813#endif
2817 INF("cmdline", S_IRUGO, pid_cmdline), 2814 INF("cmdline", S_IRUGO, proc_pid_cmdline),
2818 ONE("stat", S_IRUGO, tid_stat), 2815 ONE("stat", S_IRUGO, proc_tid_stat),
2819 ONE("statm", S_IRUGO, pid_statm), 2816 ONE("statm", S_IRUGO, proc_pid_statm),
2820 REG("maps", S_IRUGO, maps), 2817 REG("maps", S_IRUGO, proc_maps_operations),
2821#ifdef CONFIG_NUMA 2818#ifdef CONFIG_NUMA
2822 REG("numa_maps", S_IRUGO, numa_maps), 2819 REG("numa_maps", S_IRUGO, proc_numa_maps_operations),
2823#endif 2820#endif
2824 REG("mem", S_IRUSR|S_IWUSR, mem), 2821 REG("mem", S_IRUSR|S_IWUSR, proc_mem_operations),
2825 LNK("cwd", cwd), 2822 LNK("cwd", proc_cwd_link),
2826 LNK("root", root), 2823 LNK("root", proc_root_link),
2827 LNK("exe", exe), 2824 LNK("exe", proc_exe_link),
2828 REG("mounts", S_IRUGO, mounts), 2825 REG("mounts", S_IRUGO, proc_mounts_operations),
2829 REG("mountinfo", S_IRUGO, mountinfo), 2826 REG("mountinfo", S_IRUGO, proc_mountinfo_operations),
2830#ifdef CONFIG_PROC_PAGE_MONITOR 2827#ifdef CONFIG_PROC_PAGE_MONITOR
2831 REG("clear_refs", S_IWUSR, clear_refs), 2828 REG("clear_refs", S_IWUSR, proc_clear_refs_operations),
2832 REG("smaps", S_IRUGO, smaps), 2829 REG("smaps", S_IRUGO, proc_smaps_operations),
2833 REG("pagemap", S_IRUSR, pagemap), 2830 REG("pagemap", S_IRUSR, proc_pagemap_operations),
2834#endif 2831#endif
2835#ifdef CONFIG_SECURITY 2832#ifdef CONFIG_SECURITY
2836 DIR("attr", S_IRUGO|S_IXUGO, attr_dir), 2833 DIR("attr", S_IRUGO|S_IXUGO, proc_attr_dir_inode_operations, proc_attr_dir_operations),
2837#endif 2834#endif
2838#ifdef CONFIG_KALLSYMS 2835#ifdef CONFIG_KALLSYMS
2839 INF("wchan", S_IRUGO, pid_wchan), 2836 INF("wchan", S_IRUGO, proc_pid_wchan),
2840#endif 2837#endif
2841#ifdef CONFIG_SCHEDSTATS 2838#ifdef CONFIG_SCHEDSTATS
2842 INF("schedstat", S_IRUGO, pid_schedstat), 2839 INF("schedstat", S_IRUGO, proc_pid_schedstat),
2843#endif 2840#endif
2844#ifdef CONFIG_LATENCYTOP 2841#ifdef CONFIG_LATENCYTOP
2845 REG("latency", S_IRUGO, lstats), 2842 REG("latency", S_IRUGO, proc_lstats_operations),
2846#endif 2843#endif
2847#ifdef CONFIG_PROC_PID_CPUSET 2844#ifdef CONFIG_PROC_PID_CPUSET
2848 REG("cpuset", S_IRUGO, cpuset), 2845 REG("cpuset", S_IRUGO, proc_cpuset_operations),
2849#endif 2846#endif
2850#ifdef CONFIG_CGROUPS 2847#ifdef CONFIG_CGROUPS
2851 REG("cgroup", S_IRUGO, cgroup), 2848 REG("cgroup", S_IRUGO, proc_cgroup_operations),
2852#endif 2849#endif
2853 INF("oom_score", S_IRUGO, oom_score), 2850 INF("oom_score", S_IRUGO, proc_oom_score),
2854 REG("oom_adj", S_IRUGO|S_IWUSR, oom_adjust), 2851 REG("oom_adj", S_IRUGO|S_IWUSR, proc_oom_adjust_operations),
2855#ifdef CONFIG_AUDITSYSCALL 2852#ifdef CONFIG_AUDITSYSCALL
2856 REG("loginuid", S_IWUSR|S_IRUGO, loginuid), 2853 REG("loginuid", S_IWUSR|S_IRUGO, proc_loginuid_operations),
2857 REG("sessionid", S_IRUSR, sessionid), 2854 REG("sessionid", S_IRUSR, proc_sessionid_operations),
2858#endif 2855#endif
2859#ifdef CONFIG_FAULT_INJECTION 2856#ifdef CONFIG_FAULT_INJECTION
2860 REG("make-it-fail", S_IRUGO|S_IWUSR, fault_inject), 2857 REG("make-it-fail", S_IRUGO|S_IWUSR, proc_fault_inject_operations),
2861#endif 2858#endif
2862#ifdef CONFIG_TASK_IO_ACCOUNTING 2859#ifdef CONFIG_TASK_IO_ACCOUNTING
2863 INF("io", S_IRUGO, tid_io_accounting), 2860 INF("io", S_IRUGO, proc_tid_io_accounting),
2864#endif 2861#endif
2865}; 2862};
2866 2863