Lines Matching refs:nr
60 #define BITBIT_NR(nr) BITS_TO_LONGS(BITS_TO_LONGS(nr)) argument
61 #define BITBIT_SIZE(nr) (BITBIT_NR(nr) * sizeof(long)) argument
104 static struct fdtable * alloc_fdtable(unsigned int nr) in alloc_fdtable() argument
116 nr /= (1024 / sizeof(struct file *)); in alloc_fdtable()
117 nr = roundup_pow_of_two(nr + 1); in alloc_fdtable()
118 nr *= (1024 / sizeof(struct file *)); in alloc_fdtable()
127 if (unlikely(nr > sysctl_nr_open)) in alloc_fdtable()
128 nr = ((sysctl_nr_open - 1) | (BITS_PER_LONG - 1)) + 1; in alloc_fdtable()
133 fdt->max_fds = nr; in alloc_fdtable()
134 data = alloc_fdmem(nr * sizeof(struct file *)); in alloc_fdtable()
140 2 * nr / BITS_PER_BYTE + BITBIT_SIZE(nr), L1_CACHE_BYTES)); in alloc_fdtable()
144 data += nr / BITS_PER_BYTE; in alloc_fdtable()
146 data += nr / BITS_PER_BYTE; in alloc_fdtable()
166 static int expand_fdtable(struct files_struct *files, unsigned int nr) in expand_fdtable() argument
173 new_fdt = alloc_fdtable(nr); in expand_fdtable()
188 if (unlikely(new_fdt->max_fds <= nr)) { in expand_fdtable()
193 BUG_ON(nr < cur_fdt->max_fds); in expand_fdtable()
211 static int expand_files(struct files_struct *files, unsigned int nr) in expand_files() argument
222 if (nr < fdt->max_fds) in expand_files()
226 if (nr >= sysctl_nr_open) in expand_files()
239 expanded = expand_fdtable(files, nr); in expand_files()