Lines Matching refs:max_fds
60 set = (nfdt->max_fds - count) / BITS_PER_BYTE; in copy_fd_bitmaps()
67 set = BITBIT_SIZE(nfdt->max_fds) - cpy; in copy_fd_bitmaps()
80 BUG_ON(nfdt->max_fds < ofdt->max_fds); in copy_fdtable()
82 cpy = ofdt->max_fds * sizeof(struct file *); in copy_fdtable()
83 set = (nfdt->max_fds - ofdt->max_fds) * sizeof(struct file *); in copy_fdtable()
87 copy_fd_bitmaps(nfdt, ofdt, ofdt->max_fds); in copy_fdtable()
135 fdt->max_fds = nr; in alloc_fdtable()
191 if (unlikely(new_fdt->max_fds <= nr)) { in expand_fdtable()
196 BUG_ON(nr < cur_fdt->max_fds); in expand_fdtable()
225 if (nr < fdt->max_fds) in expand_files()
276 unsigned int size = fdt->max_fds; in count_open_files()
301 static unsigned int sane_fdtable_size(struct fdtable *fdt, unsigned int max_fds) in sane_fdtable_size() argument
306 if (max_fds < NR_OPEN_DEFAULT) in sane_fdtable_size()
307 max_fds = NR_OPEN_DEFAULT; in sane_fdtable_size()
308 return ALIGN(min(count, max_fds), BITS_PER_LONG); in sane_fdtable_size()
316 struct files_struct *dup_fd(struct files_struct *oldf, unsigned int max_fds, int *errorp) in dup_fd() argument
335 new_fdt->max_fds = NR_OPEN_DEFAULT; in dup_fd()
343 open_files = sane_fdtable_size(old_fdt, max_fds); in dup_fd()
348 while (unlikely(open_files > new_fdt->max_fds)) { in dup_fd()
361 if (unlikely(new_fdt->max_fds < open_files)) { in dup_fd()
374 open_files = sane_fdtable_size(old_fdt, max_fds); in dup_fd()
400 memset(new_fds, 0, (new_fdt->max_fds - open_files) * sizeof(struct file *)); in dup_fd()
425 if (i >= fdt->max_fds) in close_files()
497 .max_fds = NR_OPEN_DEFAULT,
509 unsigned int maxfd = fdt->max_fds; in find_next_fd()
538 if (fd < fdt->max_fds) in __alloc_fd()
678 if (fd >= fdt->max_fds) in pick_file()
728 cur_max = files_fdtable(cur_fds)->max_fds; in __close_range()
795 if (fd >= fdt->max_fds) in __close_fd_get_file()
838 if (fd >= fdt->max_fds) in do_close_on_exec()
871 if (unlikely(fd >= fdt->max_fds)) in __fget_files_rcu()
874 fdentry = fdt->fd + array_index_nospec(fd, fdt->max_fds); in __fget_files_rcu()
1272 for (fdt = files_fdtable(files); n < fdt->max_fds; n++) { in iterate_fd()