diff options
author | netchild <netchild@FreeBSD.org> | 2006-12-31 12:39:10 +0000 |
---|---|---|
committer | netchild <netchild@FreeBSD.org> | 2006-12-31 12:39:10 +0000 |
commit | 938b19deb7f08d648cbea47aad31cd593e8f79f2 (patch) | |
tree | 5f7a66921f13b7a6f4b7bf8ae9af0f639d8d2e9f /sys/compat/linux/linux_misc.c | |
parent | e9779a03516fdd2696ca38a5163c7b9d58de9be0 (diff) | |
download | FreeBSD-src-938b19deb7f08d648cbea47aad31cd593e8f79f2.zip FreeBSD-src-938b19deb7f08d648cbea47aad31cd593e8f79f2.tar.gz |
MFp4 (111746+):
Redo the checking for 2.6 emulation. We now cache the value of
use26 and replace calls to linux_get_osrelease() + parsing with
a call to linux_use26(). Typical path is lockless now.
Pointed out by: kib
This allows to ship RELENG_7_0 with a default osrelease of 2.4.2 and the
possibility to enable 2.6.x emulation without the possible performance
impact of the previous version of the check.
Submitted by: rdivacky
Diffstat (limited to 'sys/compat/linux/linux_misc.c')
-rw-r--r-- | sys/compat/linux/linux_misc.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/sys/compat/linux/linux_misc.c b/sys/compat/linux/linux_misc.c index 6fd69e0..489b079 100644 --- a/sys/compat/linux/linux_misc.c +++ b/sys/compat/linux/linux_misc.c @@ -1400,15 +1400,13 @@ int linux_getpid(struct thread *td, struct linux_getpid_args *args) { struct linux_emuldata *em; - char osrel[LINUX_MAX_UTSNAME]; #ifdef DEBUG if (ldebug(getpid)) printf(ARGS(getpid, "")); #endif - linux_get_osrelease(td, osrel); - if (strlen(osrel) >= 3 && osrel[2] == '6') { + if (linux_use26(td)) { em = em_find(td->td_proc, EMUL_UNLOCKED); KASSERT(em != NULL, ("getpid: emuldata not found.\n")); td->td_retval[0] = em->shared->group_pid; @@ -1438,15 +1436,13 @@ linux_getppid(struct thread *td, struct linux_getppid_args *args) { struct linux_emuldata *em; struct proc *p, *pp; - char osrel[LINUX_MAX_UTSNAME]; #ifdef DEBUG if (ldebug(getppid)) printf(ARGS(getppid, "")); #endif - linux_get_osrelease(td, osrel); - if (strlen(osrel) >= 3 && osrel[2] != '6') { + if (!linux_use26(td)) { PROC_LOCK(td->td_proc); td->td_retval[0] = td->td_proc->p_pptr->p_pid; PROC_UNLOCK(td->td_proc); @@ -1573,15 +1569,13 @@ linux_exit_group(struct thread *td, struct linux_exit_group_args *args) { struct linux_emuldata *em, *td_em, *tmp_em; struct proc *sp; - char osrel[LINUX_MAX_UTSNAME]; #ifdef DEBUG if (ldebug(exit_group)) printf(ARGS(exit_group, "%i"), args->error_code); #endif - linux_get_osrelease(td, osrel); - if (strlen(osrel) >= 3 && osrel[2] == '6') { + if (linux_use26(td)) { td_em = em_find(td->td_proc, EMUL_UNLOCKED); KASSERT(td_em != NULL, ("exit_group: emuldata not found.\n")); |