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()
119 fdt->max_fds = nr; in alloc_fdtable()
175 if (unlikely(new_fdt->max_fds <= nr)) { in expand_fdtable()
180 BUG_ON(nr < cur_fdt->max_fds); in expand_fdtable()
209 if (nr < fdt->max_fds) in expand_files()
260 unsigned int size = fdt->max_fds; in count_open_files()
272 static unsigned int sane_fdtable_size(struct fdtable *fdt, unsigned int max_fds) in sane_fdtable_size() argument
277 if (max_fds < NR_OPEN_DEFAULT) in sane_fdtable_size()
278 max_fds = NR_OPEN_DEFAULT; in sane_fdtable_size()
279 return min(count, max_fds); in sane_fdtable_size()
287 struct files_struct *dup_fd(struct files_struct *oldf, unsigned int max_fds, int *errorp) in dup_fd() argument
306 new_fdt->max_fds = NR_OPEN_DEFAULT; in dup_fd()
314 open_files = sane_fdtable_size(old_fdt, max_fds); in dup_fd()
319 while (unlikely(open_files > new_fdt->max_fds)) { in dup_fd()
332 if (unlikely(new_fdt->max_fds < open_files)) { in dup_fd()
345 open_files = sane_fdtable_size(old_fdt, max_fds); in dup_fd()
371 memset(new_fds, 0, (new_fdt->max_fds - open_files) * sizeof(struct file *)); in dup_fd()
396 if (i >= fdt->max_fds) in close_files()
443 .max_fds = NR_OPEN_DEFAULT,
455 unsigned int maxfd = fdt->max_fds; in find_next_fd()
484 if (fd < fdt->max_fds) in alloc_fd()
616 if (fd >= fdt->max_fds) { in pick_file()
656 return fdt->max_fds - 1; in last_fd()
776 if (fd >= fdt->max_fds) in __close_fd_get_file()
819 if (fd >= fdt->max_fds) in do_close_on_exec()
927 for (; fd < files_fdtable(files)->max_fds; fd++) { in task_lookup_next_fd_rcu()
1251 for (fdt = files_fdtable(files); n < fdt->max_fds; n++) { in iterate_fd()