Lines Matching refs:nr
59 #define BITBIT_NR(nr) BITS_TO_LONGS(BITS_TO_LONGS(nr)) argument
60 #define BITBIT_SIZE(nr) (BITBIT_NR(nr) * sizeof(long)) argument
103 static struct fdtable * alloc_fdtable(unsigned int nr) in alloc_fdtable() argument
115 nr /= (1024 / sizeof(struct file *)); in alloc_fdtable()
116 nr = roundup_pow_of_two(nr + 1); in alloc_fdtable()
117 nr *= (1024 / sizeof(struct file *)); in alloc_fdtable()
126 if (unlikely(nr > sysctl_nr_open)) in alloc_fdtable()
127 nr = ((sysctl_nr_open - 1) | (BITS_PER_LONG - 1)) + 1; in alloc_fdtable()
132 fdt->max_fds = nr; in alloc_fdtable()
133 data = alloc_fdmem(nr * sizeof(struct file *)); in alloc_fdtable()
139 2 * nr / BITS_PER_BYTE + BITBIT_SIZE(nr), L1_CACHE_BYTES)); in alloc_fdtable()
143 data += nr / BITS_PER_BYTE; in alloc_fdtable()
145 data += nr / BITS_PER_BYTE; in alloc_fdtable()
165 static int expand_fdtable(struct files_struct *files, int nr) in expand_fdtable() argument
172 new_fdt = alloc_fdtable(nr); in expand_fdtable()
187 if (unlikely(new_fdt->max_fds <= nr)) { in expand_fdtable()
192 BUG_ON(nr < cur_fdt->max_fds); in expand_fdtable()
210 static int expand_files(struct files_struct *files, int nr) in expand_files() argument
221 if (nr < fdt->max_fds) in expand_files()
225 if (nr >= sysctl_nr_open) in expand_files()
238 expanded = expand_fdtable(files, nr); in expand_files()