Lines Matching defs:max_fds

60 	set = (nfdt->max_fds - count) / BITS_PER_BYTE;
67 set = BITBIT_SIZE(nfdt->max_fds) - cpy;
80 BUG_ON(nfdt->max_fds < ofdt->max_fds);
82 cpy = ofdt->max_fds * sizeof(struct file *);
83 set = (nfdt->max_fds - ofdt->max_fds) * sizeof(struct file *);
87 copy_fd_bitmaps(nfdt, ofdt, ofdt->max_fds);
135 fdt->max_fds = nr;
191 if (unlikely(new_fdt->max_fds <= nr)) {
196 BUG_ON(nr < cur_fdt->max_fds);
225 if (nr < fdt->max_fds)
276 unsigned int size = fdt->max_fds;
292 * 'max_fds' will normally already be properly aligned, but it
295 * up having a 'max_fds' value that isn't already aligned.
301 static unsigned int sane_fdtable_size(struct fdtable *fdt, unsigned int max_fds)
306 if (max_fds < NR_OPEN_DEFAULT)
307 max_fds = NR_OPEN_DEFAULT;
308 return ALIGN(min(count, max_fds), BITS_PER_LONG);
316 struct files_struct *dup_fd(struct files_struct *oldf, unsigned int max_fds, int *errorp)
335 new_fdt->max_fds = NR_OPEN_DEFAULT;
343 open_files = sane_fdtable_size(old_fdt, max_fds);
348 while (unlikely(open_files > new_fdt->max_fds)) {
361 if (unlikely(new_fdt->max_fds < open_files)) {
374 open_files = sane_fdtable_size(old_fdt, max_fds);
400 memset(new_fds, 0, (new_fdt->max_fds - open_files) * sizeof(struct file *));
425 if (i >= fdt->max_fds)
472 .max_fds = NR_OPEN_DEFAULT,
484 unsigned int maxfd = fdt->max_fds;
513 if (fd < fdt->max_fds)
649 if (fd >= fdt->max_fds)
652 fd = array_index_nospec(fd, fdt->max_fds);
686 return fdt->max_fds - 1;
833 if (fd >= fdt->max_fds)
964 nospec_mask = array_index_mask_nospec(fd, fdt->max_fds);
1103 for (; fd < files_fdtable(files)->max_fds; fd++) {
1450 for (fdt = files_fdtable(files); n < fdt->max_fds; n++) {