linux_radix.c (290135) | linux_radix.c (298829) |
---|---|
1/*- 2 * Copyright (c) 2010 Isilon Systems, Inc. 3 * Copyright (c) 2010 iX Systems, Inc. 4 * Copyright (c) 2010 Panasas, Inc. 5 * Copyright (c) 2013, 2014 Mellanox Technologies, Ltd. 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 14 unchanged lines hidden (view full) --- 23 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 */ 29 30#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2010 Isilon Systems, Inc. 3 * Copyright (c) 2010 iX Systems, Inc. 4 * Copyright (c) 2010 Panasas, Inc. 5 * Copyright (c) 2013, 2014 Mellanox Technologies, Ltd. 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 14 unchanged lines hidden (view full) --- 23 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 */ 29 30#include <sys/cdefs.h> |
31__FBSDID("$FreeBSD: head/sys/compat/linuxkpi/common/src/linux_radix.c 290135 2015-10-29 08:28:39Z hselasky $"); | 31__FBSDID("$FreeBSD: head/sys/compat/linuxkpi/common/src/linux_radix.c 298829 2016-04-30 00:53:10Z pfg $"); |
32 33#include <sys/param.h> 34#include <sys/systm.h> 35#include <sys/malloc.h> 36#include <sys/kernel.h> 37#include <sys/sysctl.h> 38 39#include <linux/slab.h> --- 142 unchanged lines hidden (view full) --- 182 183 /* allocate the missing radix levels, if any */ 184 for (idx = 0; idx != height; idx++) { 185 temp[idx] = malloc(sizeof(*node), M_RADIX, 186 root->gfp_mask | M_ZERO); 187 if (temp[idx] == NULL) { 188 while(idx--) 189 free(temp[idx], M_RADIX); | 32 33#include <sys/param.h> 34#include <sys/systm.h> 35#include <sys/malloc.h> 36#include <sys/kernel.h> 37#include <sys/sysctl.h> 38 39#include <linux/slab.h> --- 142 unchanged lines hidden (view full) --- 182 183 /* allocate the missing radix levels, if any */ 184 for (idx = 0; idx != height; idx++) { 185 temp[idx] = malloc(sizeof(*node), M_RADIX, 186 root->gfp_mask | M_ZERO); 187 if (temp[idx] == NULL) { 188 while(idx--) 189 free(temp[idx], M_RADIX); |
190 /* check if we should free the root node aswell */ | 190 /* Check if we should free the root node as well. */ |
191 if (root->rnode->count == 0) { 192 free(root->rnode, M_RADIX); 193 root->rnode = NULL; 194 root->height = 0; 195 } 196 return (-ENOMEM); 197 } 198 } --- 20 unchanged lines hidden --- | 191 if (root->rnode->count == 0) { 192 free(root->rnode, M_RADIX); 193 root->rnode = NULL; 194 root->height = 0; 195 } 196 return (-ENOMEM); 197 } 198 } --- 20 unchanged lines hidden --- |