diff options
author | Thomas Petazzoni <thomas.petazzoni@free-electrons.com> | 2008-08-06 09:12:22 -0400 |
---|---|---|
committer | J. Bruce Fields <bfields@citi.umich.edu> | 2008-09-29 17:56:57 -0400 |
commit | bfcd17a6c5529bc37234cfa720a047cf9397bcfc (patch) | |
tree | f4e087479a8c559f1a5ca3be96c64afd172e12c1 /kernel | |
parent | 04716e6621ff4abb422d64ba7b48718f52716a3e (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 'kernel')
-rw-r--r-- | kernel/sys_ni.c | 1 | ||||
-rw-r--r-- | kernel/sysctl.c | 6 |
2 files changed, 6 insertions, 1 deletions
diff --git a/kernel/sys_ni.c b/kernel/sys_ni.c index 08d6e1bb99ac..503d8d4eb80a 100644 --- a/kernel/sys_ni.c +++ b/kernel/sys_ni.c | |||
@@ -125,6 +125,7 @@ cond_syscall(sys_vm86old); | |||
125 | cond_syscall(sys_vm86); | 125 | cond_syscall(sys_vm86); |
126 | cond_syscall(compat_sys_ipc); | 126 | cond_syscall(compat_sys_ipc); |
127 | cond_syscall(compat_sys_sysctl); | 127 | cond_syscall(compat_sys_sysctl); |
128 | cond_syscall(sys_flock); | ||
128 | 129 | ||
129 | /* arch-specific weak syscall entries */ | 130 | /* arch-specific weak syscall entries */ |
130 | cond_syscall(sys_pciconfig_read); | 131 | cond_syscall(sys_pciconfig_read); |
diff --git a/kernel/sysctl.c b/kernel/sysctl.c index 50ec0886fa3d..4588b2cf2ecb 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c | |||
@@ -97,7 +97,7 @@ static int sixty = 60; | |||
97 | static int neg_one = -1; | 97 | static int neg_one = -1; |
98 | #endif | 98 | #endif |
99 | 99 | ||
100 | #ifdef CONFIG_MMU | 100 | #if defined(CONFIG_MMU) && defined(CONFIG_FILE_LOCKING) |
101 | static int two = 2; | 101 | static int two = 2; |
102 | #endif | 102 | #endif |
103 | 103 | ||
@@ -1261,6 +1261,7 @@ static struct ctl_table fs_table[] = { | |||
1261 | .extra1 = &minolduid, | 1261 | .extra1 = &minolduid, |
1262 | .extra2 = &maxolduid, | 1262 | .extra2 = &maxolduid, |
1263 | }, | 1263 | }, |
1264 | #ifdef CONFIG_FILE_LOCKING | ||
1264 | { | 1265 | { |
1265 | .ctl_name = FS_LEASES, | 1266 | .ctl_name = FS_LEASES, |
1266 | .procname = "leases-enable", | 1267 | .procname = "leases-enable", |
@@ -1269,6 +1270,7 @@ static struct ctl_table fs_table[] = { | |||
1269 | .mode = 0644, | 1270 | .mode = 0644, |
1270 | .proc_handler = &proc_dointvec, | 1271 | .proc_handler = &proc_dointvec, |
1271 | }, | 1272 | }, |
1273 | #endif | ||
1272 | #ifdef CONFIG_DNOTIFY | 1274 | #ifdef CONFIG_DNOTIFY |
1273 | { | 1275 | { |
1274 | .ctl_name = FS_DIR_NOTIFY, | 1276 | .ctl_name = FS_DIR_NOTIFY, |
@@ -1280,6 +1282,7 @@ static struct ctl_table fs_table[] = { | |||
1280 | }, | 1282 | }, |
1281 | #endif | 1283 | #endif |
1282 | #ifdef CONFIG_MMU | 1284 | #ifdef CONFIG_MMU |
1285 | #ifdef CONFIG_FILE_LOCKING | ||
1283 | { | 1286 | { |
1284 | .ctl_name = FS_LEASE_TIME, | 1287 | .ctl_name = FS_LEASE_TIME, |
1285 | .procname = "lease-break-time", | 1288 | .procname = "lease-break-time", |
@@ -1291,6 +1294,7 @@ static struct ctl_table fs_table[] = { | |||
1291 | .extra1 = &zero, | 1294 | .extra1 = &zero, |
1292 | .extra2 = &two, | 1295 | .extra2 = &two, |
1293 | }, | 1296 | }, |
1297 | #endif | ||
1294 | { | 1298 | { |
1295 | .procname = "aio-nr", | 1299 | .procname = "aio-nr", |
1296 | .data = &aio_nr, | 1300 | .data = &aio_nr, |