aboutsummaryrefslogtreecommitdiffstats
path: root/fs/locks.c
diff options
context:
space:
mode:
authorAlexey Dobriyan <adobriyan@gmail.com>2008-10-04 14:34:18 -0400
committerAlexey Dobriyan <adobriyan@gmail.com>2008-10-23 06:37:00 -0400
commitd8ba7a363393f803c93c8cffabd6d0362618bc2a (patch)
tree331010c221eb9dfe396b2e6958a08f0fb695e117 /fs/locks.c
parentae048112c099b0f3adb57f7c0b3a49bc62244609 (diff)
proc: move rest of /proc/locks to fs/locks.c
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Diffstat (limited to 'fs/locks.c')
-rw-r--r--fs/locks.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/fs/locks.c b/fs/locks.c
index 5eb259e3cd38..90e87f57b331 100644
--- a/fs/locks.c
+++ b/fs/locks.c
@@ -2078,6 +2078,7 @@ int vfs_cancel_lock(struct file *filp, struct file_lock *fl)
2078EXPORT_SYMBOL_GPL(vfs_cancel_lock); 2078EXPORT_SYMBOL_GPL(vfs_cancel_lock);
2079 2079
2080#ifdef CONFIG_PROC_FS 2080#ifdef CONFIG_PROC_FS
2081#include <linux/proc_fs.h>
2081#include <linux/seq_file.h> 2082#include <linux/seq_file.h>
2082 2083
2083static void lock_get_status(struct seq_file *f, struct file_lock *fl, 2084static void lock_get_status(struct seq_file *f, struct file_lock *fl,
@@ -2183,12 +2184,31 @@ static void locks_stop(struct seq_file *f, void *v)
2183 unlock_kernel(); 2184 unlock_kernel();
2184} 2185}
2185 2186
2186struct seq_operations locks_seq_operations = { 2187static const struct seq_operations locks_seq_operations = {
2187 .start = locks_start, 2188 .start = locks_start,
2188 .next = locks_next, 2189 .next = locks_next,
2189 .stop = locks_stop, 2190 .stop = locks_stop,
2190 .show = locks_show, 2191 .show = locks_show,
2191}; 2192};
2193
2194static int locks_open(struct inode *inode, struct file *filp)
2195{
2196 return seq_open(filp, &locks_seq_operations);
2197}
2198
2199static const struct file_operations proc_locks_operations = {
2200 .open = locks_open,
2201 .read = seq_read,
2202 .llseek = seq_lseek,
2203 .release = seq_release,
2204};
2205
2206static int __init proc_locks_init(void)
2207{
2208 proc_create("locks", 0, NULL, &proc_locks_operations);
2209 return 0;
2210}
2211module_init(proc_locks_init);
2192#endif 2212#endif
2193 2213
2194/** 2214/**