Commit 7f4b36f9bb930b3b2105a9a2cb0121fa7028c432
1 parent
4d35950734
Exists in
master
and in
13 other branches
get rid of files_defer_init()
the only thing it's doing these days is calculation of upper limit for fs.nr_open sysctl and that can be done statically Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Showing 3 changed files with 4 additions and 10 deletions Side-by-side Diff
fs/file.c
... | ... | @@ -25,7 +25,10 @@ |
25 | 25 | |
26 | 26 | int sysctl_nr_open __read_mostly = 1024*1024; |
27 | 27 | int sysctl_nr_open_min = BITS_PER_LONG; |
28 | -int sysctl_nr_open_max = 1024 * 1024; /* raised later */ | |
28 | +/* our max() is unusable in constant expressions ;-/ */ | |
29 | +#define __const_max(x, y) ((x) < (y) ? (x) : (y)) | |
30 | +int sysctl_nr_open_max = __const_max(INT_MAX, ~(size_t)0/sizeof(void *)) & | |
31 | + -BITS_PER_LONG; | |
29 | 32 | |
30 | 33 | static void *alloc_fdmem(size_t size) |
31 | 34 | { |
... | ... | @@ -427,12 +430,6 @@ |
427 | 430 | task_unlock(tsk); |
428 | 431 | put_files_struct(files); |
429 | 432 | } |
430 | -} | |
431 | - | |
432 | -void __init files_defer_init(void) | |
433 | -{ | |
434 | - sysctl_nr_open_max = min((size_t)INT_MAX, ~(size_t)0/sizeof(void *)) & | |
435 | - -BITS_PER_LONG; | |
436 | 433 | } |
437 | 434 | |
438 | 435 | struct files_struct init_files = { |
fs/file_table.c
include/linux/fdtable.h