Date: Thu, 23 Dec 2010 21:01:50 GMT From: Edward Tomasz Napierala <trasz@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 187167 for review Message-ID: <201012232101.oBNL1oMm031038@skunkworks.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://p4web.freebsd.org/@@187167?ac=10 Change 187167 by trasz@trasz_victim on 2010/12/23 21:01:45 In struct pts_softc, replace uidinfo with ucred. Affected files ... .. //depot/projects/soc2009/trasz_limits/sys/kern/tty_pts.c#22 edit Differences ... ==== //depot/projects/soc2009/trasz_limits/sys/kern/tty_pts.c#22 (text+ko) ==== @@ -98,7 +98,7 @@ struct cdev *pts_cdev; /* (c) Master device node. */ #endif /* PTS_EXTERNAL */ - struct uidinfo *pts_uidinfo; /* (c) Resource limit. */ + struct ucred *pts_cred; /* (c) Resource limit. */ }; /* @@ -684,8 +684,8 @@ if (psc->pts_unit >= 0) free_unr(pts_pool, psc->pts_unit); - chgptscnt(psc->pts_uidinfo, -1, 0); - uifree(psc->pts_uidinfo); + chgptscnt(psc->pts_cred->cr_ruidinfo, -1, 0); + crfree(psc->pts_cred); knlist_destroy(&psc->pts_inpoll.si_note); knlist_destroy(&psc->pts_outpoll.si_note); @@ -719,14 +719,14 @@ struct tty *tp; struct pts_softc *psc; struct proc *p = td->td_proc; - struct uidinfo *uid = td->td_ucred->cr_ruidinfo; + struct ucred *cred = td->td_ucred; /* Resource limiting. */ error = rusage_add(p, RUSAGE_NPTS, 1); if (error != 0) return (EAGAIN); PROC_LOCK(p); - ok = chgptscnt(uid, 1, lim_cur(p, RLIMIT_NPTS)); + ok = chgptscnt(cred->cr_ruidinfo, 1, lim_cur(p, RLIMIT_NPTS)); PROC_UNLOCK(p); if (!ok) { rusage_sub(p, RUSAGE_NPTS, 1); @@ -737,7 +737,7 @@ unit = alloc_unr(pts_pool); if (unit < 0) { rusage_sub(p, RUSAGE_NPTS, 1); - chgptscnt(uid, -1, 0); + chgptscnt(cred->cr_ruidinfo, -1, 0); return (EAGAIN); } @@ -747,8 +747,7 @@ cv_init(&psc->pts_outwait, "ptsout"); psc->pts_unit = unit; - psc->pts_uidinfo = uid; - uihold(uid); + psc->pts_cred = crhold(cred); tp = tty_alloc(&pts_class, psc); knlist_init_mtx(&psc->pts_inpoll.si_note, tp->t_mtx); @@ -771,14 +770,14 @@ struct tty *tp; struct pts_softc *psc; struct proc *p = td->td_proc; - struct uidinfo *uid = td->td_ucred->cr_ruidinfo; + struct ucred *cred = td->td_ucred; /* Resource limiting. */ error = rusage_add(p, RUSAGE_NPTS, 1); if (error != 0) return (EAGAIN); PROC_LOCK(p); - ok = chgptscnt(uid, 1, lim_cur(p, RLIMIT_NPTS)); + ok = chgptscnt(cred->cr_ruidinfo, 1, lim_cur(p, RLIMIT_NPTS)); PROC_UNLOCK(p); if (!ok) { rusage_sub(p, RUSAGE_NPTS, 1); @@ -792,8 +791,7 @@ psc->pts_unit = -1; psc->pts_cdev = dev; - psc->pts_uidinfo = uid; - uihold(uid); + psc->pts_cred = crhold(cred);; tp = tty_alloc(&pts_class, psc); knlist_init_mtx(&psc->pts_inpoll.si_note, tp->t_mtx);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201012232101.oBNL1oMm031038>