aboutsummaryrefslogtreecommitdiffstats
path: root/fs/locks.c
diff options
context:
space:
mode:
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 20457486d6b2..09062e3ff104 100644
--- a/fs/locks.c
+++ b/fs/locks.c
@@ -2079,6 +2079,7 @@ int vfs_cancel_lock(struct file *filp, struct file_lock *fl)
2079EXPORT_SYMBOL_GPL(vfs_cancel_lock); 2079EXPORT_SYMBOL_GPL(vfs_cancel_lock);
2080 2080
2081#ifdef CONFIG_PROC_FS 2081#ifdef CONFIG_PROC_FS
2082#include <linux/proc_fs.h>
2082#include <linux/seq_file.h> 2083#include <linux/seq_file.h>
2083 2084
2084static void lock_get_status(struct seq_file *f, struct file_lock *fl, 2085static void lock_get_status(struct seq_file *f, struct file_lock *fl,
@@ -2184,12 +2185,31 @@ static void locks_stop(struct seq_file *f, void *v)
2184 unlock_kernel(); 2185 unlock_kernel();
2185} 2186}
2186 2187
2187struct seq_operations locks_seq_operations = { 2188static const struct seq_operations locks_seq_operations = {
2188 .start = locks_start, 2189 .start = locks_start,
2189 .next = locks_next, 2190 .next = locks_next,
2190 .stop = locks_stop, 2191 .stop = locks_stop,
2191 .show = locks_show, 2192 .show = locks_show,
2192}; 2193};
2194
2195static int locks_open(struct inode *inode, struct file *filp)
2196{
2197 return seq_open(filp, &locks_seq_operations);
2198}
2199
2200static const struct file_operations proc_locks_operations = {
2201 .open = locks_open,
2202 .read = seq_read,
2203 .llseek = seq_lseek,
2204 .release = seq_release,
2205};
2206
2207static int __init proc_locks_init(void)
2208{
2209 proc_create("locks", 0, NULL, &proc_locks_operations);
2210 return 0;
2211}
2212module_init(proc_locks_init);
2193#endif 2213#endif
2194 2214
2195/** 2215/**