Lines Matching refs:max_fds

59 	set = (nfdt->max_fds - count) / BITS_PER_BYTE;  in copy_fd_bitmaps()
66 set = BITBIT_SIZE(nfdt->max_fds) - cpy; in copy_fd_bitmaps()
79 BUG_ON(nfdt->max_fds < ofdt->max_fds); in copy_fdtable()
81 cpy = ofdt->max_fds * sizeof(struct file *); in copy_fdtable()
82 set = (nfdt->max_fds - ofdt->max_fds) * sizeof(struct file *); in copy_fdtable()
86 copy_fd_bitmaps(nfdt, ofdt, ofdt->max_fds); in copy_fdtable()
118 fdt->max_fds = nr; in alloc_fdtable()
174 if (unlikely(new_fdt->max_fds <= nr)) { in expand_fdtable()
179 BUG_ON(nr < cur_fdt->max_fds); in expand_fdtable()
208 if (nr < fdt->max_fds) in expand_files()
259 unsigned int size = fdt->max_fds; in count_open_files()
271 static unsigned int sane_fdtable_size(struct fdtable *fdt, unsigned int max_fds) in sane_fdtable_size() argument
276 if (max_fds < NR_OPEN_DEFAULT) in sane_fdtable_size()
277 max_fds = NR_OPEN_DEFAULT; in sane_fdtable_size()
278 return min(count, max_fds); in sane_fdtable_size()
286 struct files_struct *dup_fd(struct files_struct *oldf, unsigned int max_fds, int *errorp) in dup_fd() argument
305 new_fdt->max_fds = NR_OPEN_DEFAULT; in dup_fd()
313 open_files = sane_fdtable_size(old_fdt, max_fds); in dup_fd()
318 while (unlikely(open_files > new_fdt->max_fds)) { in dup_fd()
331 if (unlikely(new_fdt->max_fds < open_files)) { in dup_fd()
344 open_files = sane_fdtable_size(old_fdt, max_fds); in dup_fd()
370 memset(new_fds, 0, (new_fdt->max_fds - open_files) * sizeof(struct file *)); in dup_fd()
395 if (i >= fdt->max_fds) in close_files()
468 .max_fds = NR_OPEN_DEFAULT,
480 unsigned int maxfd = fdt->max_fds; in find_next_fd()
509 if (fd < fdt->max_fds) in __alloc_fd()
649 if (fd >= fdt->max_fds) in pick_file()
699 cur_max = files_fdtable(cur_fds)->max_fds; in __close_range()
768 if (fd >= fdt->max_fds) in __close_fd_get_file()
797 if (fd >= fdt->max_fds) in do_close_on_exec()
1187 for (fdt = files_fdtable(files); n < fdt->max_fds; n++) { in iterate_fd()