Lines Matching refs:newfdp

4213 	struct filedesc *newfdp, *fdp = p->p_fd;
4218 MALLOC_ZONE(newfdp, struct filedesc *,
4219 sizeof(*newfdp), M_FILEDESC, M_WAITOK);
4220 if (newfdp == NULL)
4228 (void) memcpy(newfdp, fdp, sizeof(*newfdp));
4236 newfdp->fd_cdir = uth_cdir;
4246 if ( (v_dir = newfdp->fd_cdir) ) {
4249 newfdp->fd_cdir = NULL;
4252 newfdp->fd_cdir = NULL;
4254 if (newfdp->fd_cdir == NULL && fdp->fd_cdir) {
4268 if ( (v_dir = newfdp->fd_rdir) ) {
4271 newfdp->fd_rdir = NULL;
4274 newfdp->fd_rdir = NULL;
4278 if (newfdp->fd_rdir == NULL && fdp->fd_rdir) {
4287 if (newfdp->fd_cdir)
4288 vnode_rele(newfdp->fd_cdir);
4289 FREE_ZONE(newfdp, sizeof *newfdp, M_FILEDESC);
4292 newfdp->fd_refcnt = 1;
4300 if (newfdp->fd_lastfile < NDFILE)
4308 i = newfdp->fd_nfiles;
4309 while (i > 2 * NDEXTENT && i > newfdp->fd_lastfile * 2)
4314 MALLOC_ZONE(newfdp->fd_ofiles, struct fileproc **,
4316 if (newfdp->fd_ofiles == NULL) {
4317 if (newfdp->fd_cdir)
4318 vnode_rele(newfdp->fd_cdir);
4319 if (newfdp->fd_rdir)
4320 vnode_rele(newfdp->fd_rdir);
4322 FREE_ZONE(newfdp, sizeof(*newfdp), M_FILEDESC);
4325 (void) memset(newfdp->fd_ofiles, 0, i * OFILESIZE);
4328 newfdp->fd_ofileflags = (char *) &newfdp->fd_ofiles[i];
4329 newfdp->fd_nfiles = i;
4335 (void) memcpy(newfdp->fd_ofiles, fdp->fd_ofiles,
4336 (newfdp->fd_lastfile + 1) * sizeof(*fdp->fd_ofiles));
4337 (void) memcpy(newfdp->fd_ofileflags, fdp->fd_ofileflags,
4338 (newfdp->fd_lastfile + 1) * sizeof(*fdp->fd_ofileflags));
4343 if (newfdp->fd_knlistsize != -1) {
4344 fpp = &newfdp->fd_ofiles[newfdp->fd_lastfile];
4345 for (i = newfdp->fd_lastfile; i >= 0; i--, fpp--) {
4348 newfdp->fd_ofileflags[i] = 0;
4349 if (i < newfdp->fd_freefile)
4350 newfdp->fd_freefile = i;
4352 if (*fpp == NULL && i == newfdp->fd_lastfile && i > 0)
4353 newfdp->fd_lastfile--;
4355 newfdp->fd_knlist = NULL;
4356 newfdp->fd_knlistsize = -1;
4357 newfdp->fd_knhash = NULL;
4358 newfdp->fd_knhashmask = 0;
4360 fpp = newfdp->fd_ofiles;
4361 flags = newfdp->fd_ofileflags;
4363 for (i = newfdp->fd_lastfile + 1; --i >= 0; fpp++, flags++)
4382 if (i < newfdp->fd_freefile)
4383 newfdp->fd_freefile = i;
4390 return (newfdp);