X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=fs%2Ffile.c;h=8f294cfac69749024c2c2e19d4b156755130e9ed;hb=6dda80ffa4403123f30fa4c77ad948e7907f9bfb;hp=b61293badfb1a9c98742a5bcc790751979251741;hpb=d2b150d0647e055d7a71b1c33140280550b27dd6;p=sagit-ice-cold%2Fkernel_xiaomi_msm8998.git diff --git a/fs/file.c b/fs/file.c index b61293badfb1..8f294cfac697 100644 --- a/fs/file.c +++ b/fs/file.c @@ -25,7 +25,10 @@ int sysctl_nr_open __read_mostly = 1024*1024; int sysctl_nr_open_min = BITS_PER_LONG; -int sysctl_nr_open_max = 1024 * 1024; /* raised later */ +/* our max() is unusable in constant expressions ;-/ */ +#define __const_max(x, y) ((x) < (y) ? (x) : (y)) +int sysctl_nr_open_max = __const_max(INT_MAX, ~(size_t)0/sizeof(void *)) & + -BITS_PER_LONG; static void *alloc_fdmem(size_t size) { @@ -429,12 +432,6 @@ void exit_files(struct task_struct *tsk) } } -void __init files_defer_init(void) -{ - sysctl_nr_open_max = min((size_t)INT_MAX, ~(size_t)0/sizeof(void *)) & - -BITS_PER_LONG; -} - struct files_struct init_files = { .count = ATOMIC_INIT(1), .fdt = &init_files.fdtab,