aboutsummaryrefslogtreecommitdiffstats
path: root/fs/proc
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-15 19:07:40 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-15 19:07:40 -0400
commit541010e4b8921cd781ff02ae68028501457045b6 (patch)
tree58bd529d4c6e69899a0aa20afa2d7f1c23326417 /fs/proc
parente457f790d8b05977853aa238bbc667b3bb375671 (diff)
parent5e7fc436426b1f9e106f511a049de91c82ec2c53 (diff)
Merge branch 'locks' of git://linux-nfs.org/~bfields/linux
* 'locks' of git://linux-nfs.org/~bfields/linux: nfsd: remove IS_ISMNDLCK macro Rework /proc/locks via seq_files and seq_list helpers fs/locks.c: use list_for_each_entry() instead of list_for_each() NFS: clean up explicit check for mandatory locks AFS: clean up explicit check for mandatory locks 9PFS: clean up explicit check for mandatory locks GFS2: clean up explicit check for mandatory locks Cleanup macros for distinguishing mandatory locks Documentation: move locks.txt in filesystems/ locks: add warning about mandatory locking races Documentation: move mandatory locking documentation to filesystems/ locks: Fix potential OOPS in generic_setlease() Use list_first_entry in locks_wake_up_blocks locks: fix flock_lock_file() comment Memory shortage can result in inconsistent flocks state locks: kill redundant local variable locks: reverse order of posix_locks_conflict() arguments
Diffstat (limited to 'fs/proc')
-rw-r--r--fs/proc/proc_misc.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/fs/proc/proc_misc.c b/fs/proc/proc_misc.c
index b872a01ad3af..0071939c0095 100644
--- a/fs/proc/proc_misc.c
+++ b/fs/proc/proc_misc.c
@@ -66,7 +66,6 @@ extern int get_stram_list(char *);
66extern int get_filesystem_list(char *); 66extern int get_filesystem_list(char *);
67extern int get_exec_domain_list(char *); 67extern int get_exec_domain_list(char *);
68extern int get_dma_list(char *); 68extern int get_dma_list(char *);
69extern int get_locks_status (char *, char **, off_t, int);
70 69
71static int proc_calc_metrics(char *page, char **start, off_t off, 70static int proc_calc_metrics(char *page, char **start, off_t off,
72 int count, int *eof, int len) 71 int count, int *eof, int len)
@@ -624,16 +623,18 @@ static int cmdline_read_proc(char *page, char **start, off_t off,
624 return proc_calc_metrics(page, start, off, count, eof, len); 623 return proc_calc_metrics(page, start, off, count, eof, len);
625} 624}
626 625
627static int locks_read_proc(char *page, char **start, off_t off, 626static int locks_open(struct inode *inode, struct file *filp)
628 int count, int *eof, void *data)
629{ 627{
630 int len = get_locks_status(page, start, off, count); 628 return seq_open(filp, &locks_seq_operations);
631
632 if (len < count)
633 *eof = 1;
634 return len;
635} 629}
636 630
631static const struct file_operations proc_locks_operations = {
632 .open = locks_open,
633 .read = seq_read,
634 .llseek = seq_lseek,
635 .release = seq_release,
636};
637
637static int execdomains_read_proc(char *page, char **start, off_t off, 638static int execdomains_read_proc(char *page, char **start, off_t off,
638 int count, int *eof, void *data) 639 int count, int *eof, void *data)
639{ 640{
@@ -691,7 +692,6 @@ void __init proc_misc_init(void)
691#endif 692#endif
692 {"filesystems", filesystems_read_proc}, 693 {"filesystems", filesystems_read_proc},
693 {"cmdline", cmdline_read_proc}, 694 {"cmdline", cmdline_read_proc},
694 {"locks", locks_read_proc},
695 {"execdomains", execdomains_read_proc}, 695 {"execdomains", execdomains_read_proc},
696 {NULL,} 696 {NULL,}
697 }; 697 };
@@ -709,6 +709,7 @@ void __init proc_misc_init(void)
709 entry->proc_fops = &proc_kmsg_operations; 709 entry->proc_fops = &proc_kmsg_operations;
710 } 710 }
711#endif 711#endif
712 create_seq_entry("locks", 0, &proc_locks_operations);
712 create_seq_entry("devices", 0, &proc_devinfo_operations); 713 create_seq_entry("devices", 0, &proc_devinfo_operations);
713 create_seq_entry("cpuinfo", 0, &proc_cpuinfo_operations); 714 create_seq_entry("cpuinfo", 0, &proc_cpuinfo_operations);
714#ifdef CONFIG_BLOCK 715#ifdef CONFIG_BLOCK