Date: Wed, 16 Aug 2006 14:34:25 GMT From: Roman Divacky <rdivacky@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 104235 for review Message-ID: <200608161434.k7GEYPAv074955@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=104235 Change 104235 by rdivacky@rdivacky_witten on 2006/08/16 14:34:20 Make ssouhlal happy and dont lock/unlock in getpid()/exit_group() Affected files ... .. //depot/projects/soc2006/rdivacky_linuxolator/compat/linux/linux_misc.c#17 edit Differences ... ==== //depot/projects/soc2006/rdivacky_linuxolator/compat/linux/linux_misc.c#17 (text+ko) ==== @@ -1334,16 +1334,14 @@ struct linux_emuldata *em; char osrel[LINUX_MAX_UTSNAME]; - em = em_find(td->td_proc, EMUL_UNLOCKED); - - KASSERT(em != NULL, ("getpid: emuldata not found.\n")); - linux_get_osrelease(td, osrel); - if (strlen(osrel) >= 3 && osrel[2] == '6') + if (strlen(osrel) >= 3 && osrel[2] == '6') { + em = em_find(td->td_proc, EMUL_UNLOCKED); + KASSERT(em != NULL, ("getpid: emuldata not found.\n")); td->td_retval[0] = em->shared->group_pid; - else + EMUL_UNLOCK(&emul_lock); + } else td->td_retval[0] = td->td_proc->p_pid; - EMUL_UNLOCK(&emul_lock); return (0); } @@ -1475,12 +1473,11 @@ printf(ARGS(exit_group, "%i"), args->error_code); #endif - td_em = em_find(td->td_proc, EMUL_UNLOCKED); - - KASSERT(td_em != NULL, ("exit_group: emuldata not found.\n")); - linux_get_osrelease(td, osrel); if (strlen(osrel) >= 3 && osrel[2] == '6') { + td_em = em_find(td->td_proc, EMUL_UNLOCKED); + + KASSERT(td_em != NULL, ("exit_group: emuldata not found.\n")); EMUL_SHARED_RLOCK(&emul_shared_lock); LIST_FOREACH_SAFE(em, &td_em->shared->threads, threads, tmp_em) { @@ -1496,8 +1493,8 @@ } EMUL_SHARED_RUNLOCK(&emul_shared_lock); + EMUL_UNLOCK(&emul_lock); } - EMUL_UNLOCK(&emul_lock); exit1(td, W_EXITCODE(args->error_code,0));
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200608161434.k7GEYPAv074955>