linux_mib.c (96398) | linux_mib.c (109623) |
---|---|
1/*- 2 * Copyright (c) 1999 Marcel Moolenaar 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 11 unchanged lines hidden (view full) --- 20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 * | 1/*- 2 * Copyright (c) 1999 Marcel Moolenaar 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 11 unchanged lines hidden (view full) --- 20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 * |
28 * $FreeBSD: head/sys/compat/linux/linux_mib.c 96398 2002-05-11 06:06:11Z dd $ | 28 * $FreeBSD: head/sys/compat/linux/linux_mib.c 109623 2003-01-21 08:56:16Z alfred $ |
29 */ 30 31#include <sys/param.h> 32#include <sys/kernel.h> 33#include <sys/systm.h> 34#include <sys/sysctl.h> 35#include <sys/proc.h> 36#include <sys/malloc.h> --- 97 unchanged lines hidden (view full) --- 134 * see if it's still needed, and set if appropriate. If it's not, 135 * we release the mutex again to FREE(), and grab it again so as 136 * to release holding the lock. 137 */ 138 mtx_lock(&pr->pr_mtx); 139 if (pr->pr_linux == NULL) { 140 mtx_unlock(&pr->pr_mtx); 141 MALLOC(lpr, struct linux_prison *, sizeof *lpr, | 29 */ 30 31#include <sys/param.h> 32#include <sys/kernel.h> 33#include <sys/systm.h> 34#include <sys/sysctl.h> 35#include <sys/proc.h> 36#include <sys/malloc.h> --- 97 unchanged lines hidden (view full) --- 134 * see if it's still needed, and set if appropriate. If it's not, 135 * we release the mutex again to FREE(), and grab it again so as 136 * to release holding the lock. 137 */ 138 mtx_lock(&pr->pr_mtx); 139 if (pr->pr_linux == NULL) { 140 mtx_unlock(&pr->pr_mtx); 141 MALLOC(lpr, struct linux_prison *, sizeof *lpr, |
142 M_PRISON, M_WAITOK|M_ZERO); | 142 M_PRISON, M_ZERO); |
143 mtx_lock(&pr->pr_mtx); 144 if (pr->pr_linux == NULL) { 145 pr->pr_linux = lpr; 146 } else { 147 mtx_unlock(&pr->pr_mtx); 148 FREE(lpr, M_PRISON); 149 mtx_lock(&pr->pr_mtx); 150 } --- 204 unchanged lines hidden --- | 143 mtx_lock(&pr->pr_mtx); 144 if (pr->pr_linux == NULL) { 145 pr->pr_linux = lpr; 146 } else { 147 mtx_unlock(&pr->pr_mtx); 148 FREE(lpr, M_PRISON); 149 mtx_lock(&pr->pr_mtx); 150 } --- 204 unchanged lines hidden --- |