aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/locks.c22
-rw-r--r--fs/proc/proc_misc.c17
-rw-r--r--include/linux/fs.h1
3 files changed, 21 insertions, 19 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/**
diff --git a/fs/proc/proc_misc.c b/fs/proc/proc_misc.c
index fcac25edaef7..fea7d658fff6 100644
--- a/fs/proc/proc_misc.c
+++ b/fs/proc/proc_misc.c
@@ -453,20 +453,6 @@ static const struct file_operations proc_interrupts_operations = {
453 .release = seq_release, 453 .release = seq_release,
454}; 454};
455 455
456#ifdef CONFIG_FILE_LOCKING
457static int locks_open(struct inode *inode, struct file *filp)
458{
459 return seq_open(filp, &locks_seq_operations);
460}
461
462static const struct file_operations proc_locks_operations = {
463 .open = locks_open,
464 .read = seq_read,
465 .llseek = seq_lseek,
466 .release = seq_release,
467};
468#endif /* CONFIG_FILE_LOCKING */
469
470#ifdef CONFIG_PROC_PAGE_MONITOR 456#ifdef CONFIG_PROC_PAGE_MONITOR
471#define KPMSIZE sizeof(u64) 457#define KPMSIZE sizeof(u64)
472#define KPMMASK (KPMSIZE - 1) 458#define KPMMASK (KPMSIZE - 1)
@@ -605,9 +591,6 @@ void __init proc_misc_init(void)
605 proc_symlink("mounts", NULL, "self/mounts"); 591 proc_symlink("mounts", NULL, "self/mounts");
606 592
607 /* And now for trickier ones */ 593 /* And now for trickier ones */
608#ifdef CONFIG_FILE_LOCKING
609 proc_create("locks", 0, NULL, &proc_locks_operations);
610#endif
611 proc_create("devices", 0, NULL, &proc_devinfo_operations); 594 proc_create("devices", 0, NULL, &proc_devinfo_operations);
612 proc_create("cpuinfo", 0, NULL, &proc_cpuinfo_operations); 595 proc_create("cpuinfo", 0, NULL, &proc_cpuinfo_operations);
613#ifdef CONFIG_BLOCK 596#ifdef CONFIG_BLOCK
diff --git a/include/linux/fs.h b/include/linux/fs.h
index a6a625be13fc..024049543ae1 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -1037,7 +1037,6 @@ extern int vfs_setlease(struct file *, long, struct file_lock **);
1037extern int lease_modify(struct file_lock **, int); 1037extern int lease_modify(struct file_lock **, int);
1038extern int lock_may_read(struct inode *, loff_t start, unsigned long count); 1038extern int lock_may_read(struct inode *, loff_t start, unsigned long count);
1039extern int lock_may_write(struct inode *, loff_t start, unsigned long count); 1039extern int lock_may_write(struct inode *, loff_t start, unsigned long count);
1040extern struct seq_operations locks_seq_operations;
1041#else /* !CONFIG_FILE_LOCKING */ 1040#else /* !CONFIG_FILE_LOCKING */
1042#define fcntl_getlk(a, b) ({ -EINVAL; }) 1041#define fcntl_getlk(a, b) ({ -EINVAL; })
1043#define fcntl_setlk(a, b, c, d) ({ -EACCES; }) 1042#define fcntl_setlk(a, b, c, d) ({ -EACCES; })