aboutsummaryrefslogtreecommitdiffstats
path: root/fs/proc
diff options
context:
space:
mode:
authorThomas Petazzoni <thomas.petazzoni@free-electrons.com>2008-08-06 09:12:22 -0400
committerJ. Bruce Fields <bfields@citi.umich.edu>2008-09-29 17:56:57 -0400
commitbfcd17a6c5529bc37234cfa720a047cf9397bcfc (patch)
treef4e087479a8c559f1a5ca3be96c64afd172e12c1 /fs/proc
parent04716e6621ff4abb422d64ba7b48718f52716a3e (diff)
Configure out file locking features
This patch adds the CONFIG_FILE_LOCKING option which allows to remove support for advisory locks. With this patch enabled, the flock() system call, the F_GETLK, F_SETLK and F_SETLKW operations of fcntl() and NFS support are disabled. These features are not necessarly needed on embedded systems. It allows to save ~11 Kb of kernel code and data: text data bss dec hex filename 1125436 118764 212992 1457192 163c28 vmlinux.old 1114299 118564 212992 1445855 160fdf vmlinux -11137 -200 0 -11337 -2C49 +/- This patch has originally been written by Matt Mackall <mpm@selenic.com>, and is part of the Linux Tiny project. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Matt Mackall <mpm@selenic.com> Cc: matthew@wil.cx Cc: linux-fsdevel@vger.kernel.org Cc: mpm@selenic.com Cc: akpm@linux-foundation.org Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Diffstat (limited to 'fs/proc')
-rw-r--r--fs/proc/proc_misc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/proc/proc_misc.c b/fs/proc/proc_misc.c
index 29e20c6b1f7f..1aabbe2592e1 100644
--- a/fs/proc/proc_misc.c
+++ b/fs/proc/proc_misc.c
@@ -684,6 +684,7 @@ static int cmdline_read_proc(char *page, char **start, off_t off,
684 return proc_calc_metrics(page, start, off, count, eof, len); 684 return proc_calc_metrics(page, start, off, count, eof, len);
685} 685}
686 686
687#ifdef CONFIG_FILE_LOCKING
687static int locks_open(struct inode *inode, struct file *filp) 688static int locks_open(struct inode *inode, struct file *filp)
688{ 689{
689 return seq_open(filp, &locks_seq_operations); 690 return seq_open(filp, &locks_seq_operations);
@@ -695,6 +696,7 @@ static const struct file_operations proc_locks_operations = {
695 .llseek = seq_lseek, 696 .llseek = seq_lseek,
696 .release = seq_release, 697 .release = seq_release,
697}; 698};
699#endif /* CONFIG_FILE_LOCKING */
698 700
699static int execdomains_read_proc(char *page, char **start, off_t off, 701static int execdomains_read_proc(char *page, char **start, off_t off,
700 int count, int *eof, void *data) 702 int count, int *eof, void *data)
@@ -888,7 +890,9 @@ void __init proc_misc_init(void)
888#ifdef CONFIG_PRINTK 890#ifdef CONFIG_PRINTK
889 proc_create("kmsg", S_IRUSR, NULL, &proc_kmsg_operations); 891 proc_create("kmsg", S_IRUSR, NULL, &proc_kmsg_operations);
890#endif 892#endif
893#ifdef CONFIG_FILE_LOCKING
891 proc_create("locks", 0, NULL, &proc_locks_operations); 894 proc_create("locks", 0, NULL, &proc_locks_operations);
895#endif
892 proc_create("devices", 0, NULL, &proc_devinfo_operations); 896 proc_create("devices", 0, NULL, &proc_devinfo_operations);
893 proc_create("cpuinfo", 0, NULL, &proc_cpuinfo_operations); 897 proc_create("cpuinfo", 0, NULL, &proc_cpuinfo_operations);
894#ifdef CONFIG_BLOCK 898#ifdef CONFIG_BLOCK