aboutsummaryrefslogtreecommitdiffstats
path: root/fs
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
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')
-rw-r--r--fs/Kconfig8
-rw-r--r--fs/Makefile3
-rw-r--r--fs/proc/proc_misc.c4
3 files changed, 14 insertions, 1 deletions
diff --git a/fs/Kconfig b/fs/Kconfig
index abccb5dab9a8..c6ae4d4842eb 100644
--- a/fs/Kconfig
+++ b/fs/Kconfig
@@ -419,6 +419,14 @@ config FS_POSIX_ACL
419 bool 419 bool
420 default n 420 default n
421 421
422config FILE_LOCKING
423 bool "Enable POSIX file locking API" if EMBEDDED
424 default y
425 help
426 This option enables standard file locking support, required
427 for filesystems like NFS and for the flock() system
428 call. Disabling this option saves about 11k.
429
422source "fs/xfs/Kconfig" 430source "fs/xfs/Kconfig"
423source "fs/gfs2/Kconfig" 431source "fs/gfs2/Kconfig"
424 432
diff --git a/fs/Makefile b/fs/Makefile
index a1482a5eff15..4b86d433baaf 100644
--- a/fs/Makefile
+++ b/fs/Makefile
@@ -7,7 +7,7 @@
7 7
8obj-y := open.o read_write.o file_table.o super.o \ 8obj-y := open.o read_write.o file_table.o super.o \
9 char_dev.o stat.o exec.o pipe.o namei.o fcntl.o \ 9 char_dev.o stat.o exec.o pipe.o namei.o fcntl.o \
10 ioctl.o readdir.o select.o fifo.o locks.o dcache.o inode.o \ 10 ioctl.o readdir.o select.o fifo.o dcache.o inode.o \
11 attr.o bad_inode.o file.o filesystems.o namespace.o aio.o \ 11 attr.o bad_inode.o file.o filesystems.o namespace.o aio.o \
12 seq_file.o xattr.o libfs.o fs-writeback.o \ 12 seq_file.o xattr.o libfs.o fs-writeback.o \
13 pnode.o drop_caches.o splice.o sync.o utimes.o \ 13 pnode.o drop_caches.o splice.o sync.o utimes.o \
@@ -27,6 +27,7 @@ obj-$(CONFIG_ANON_INODES) += anon_inodes.o
27obj-$(CONFIG_SIGNALFD) += signalfd.o 27obj-$(CONFIG_SIGNALFD) += signalfd.o
28obj-$(CONFIG_TIMERFD) += timerfd.o 28obj-$(CONFIG_TIMERFD) += timerfd.o
29obj-$(CONFIG_EVENTFD) += eventfd.o 29obj-$(CONFIG_EVENTFD) += eventfd.o
30obj-$(CONFIG_FILE_LOCKING) += locks.o
30obj-$(CONFIG_COMPAT) += compat.o compat_ioctl.o 31obj-$(CONFIG_COMPAT) += compat.o compat_ioctl.o
31 32
32nfsd-$(CONFIG_NFSD) := nfsctl.o 33nfsd-$(CONFIG_NFSD) := nfsctl.o
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