Lines Matching refs:files

57 int expand_fd_array(struct files_struct *files, int nr)  in expand_fd_array()  argument
64 if (files->max_fds >= NR_OPEN || nr >= NR_OPEN) in expand_fd_array()
67 nfds = files->max_fds; in expand_fd_array()
68 write_unlock(&files->file_lock); in expand_fd_array()
92 write_lock(&files->file_lock); in expand_fd_array()
98 if (nfds > files->max_fds) { in expand_fd_array()
102 old_fds = xchg(&files->fd, new_fds); in expand_fd_array()
103 i = xchg(&files->max_fds, nfds); in expand_fd_array()
113 write_unlock(&files->file_lock); in expand_fd_array()
115 write_lock(&files->file_lock); in expand_fd_array()
119 write_unlock(&files->file_lock); in expand_fd_array()
121 write_lock(&files->file_lock); in expand_fd_array()
166 int expand_fdset(struct files_struct *files, int nr) in expand_fdset() argument
172 if (files->max_fdset >= NR_OPEN || nr >= NR_OPEN) in expand_fdset()
175 nfds = files->max_fdset; in expand_fdset()
176 write_unlock(&files->file_lock); in expand_fdset()
192 write_lock(&files->file_lock); in expand_fdset()
199 if (nfds > files->max_fdset) { in expand_fdset()
200 int i = files->max_fdset / (sizeof(unsigned long) * 8); in expand_fdset()
201 int count = (nfds - files->max_fdset) / 8; in expand_fdset()
208 memcpy (new_openset, files->open_fds, files->max_fdset/8); in expand_fdset()
209 memcpy (new_execset, files->close_on_exec, files->max_fdset/8); in expand_fdset()
214 nfds = xchg(&files->max_fdset, nfds); in expand_fdset()
215 new_openset = xchg(&files->open_fds, new_openset); in expand_fdset()
216 new_execset = xchg(&files->close_on_exec, new_execset); in expand_fdset()
217 write_unlock(&files->file_lock); in expand_fdset()
220 write_lock(&files->file_lock); in expand_fdset()
226 write_unlock(&files->file_lock); in expand_fdset()
231 write_lock(&files->file_lock); in expand_fdset()