if_clone.c (215317) | if_clone.c (215701) |
---|---|
1/*- 2 * Copyright (c) 1980, 1986, 1993 3 * The Regents of the University of California. 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 --- 13 unchanged lines hidden (view full) --- 22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 * 29 * @(#)if.c 8.5 (Berkeley) 1/9/95 | 1/*- 2 * Copyright (c) 1980, 1986, 1993 3 * The Regents of the University of California. 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 --- 13 unchanged lines hidden (view full) --- 22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 * 29 * @(#)if.c 8.5 (Berkeley) 1/9/95 |
30 * $FreeBSD: head/sys/net/if_clone.c 215317 2010-11-14 20:38:11Z dim $ | 30 * $FreeBSD: head/sys/net/if_clone.c 215701 2010-11-22 19:32:54Z dim $ |
31 */ 32 33#include <sys/param.h> 34#include <sys/malloc.h> 35#include <sys/limits.h> 36#include <sys/lock.h> 37#include <sys/mutex.h> 38#include <sys/kernel.h> --- 12 unchanged lines hidden (view full) --- 51#include <net/route.h> 52#include <net/vnet.h> 53 54static void if_clone_free(struct if_clone *ifc); 55static int if_clone_createif(struct if_clone *ifc, char *name, size_t len, 56 caddr_t params); 57 58static struct mtx if_cloners_mtx; | 31 */ 32 33#include <sys/param.h> 34#include <sys/malloc.h> 35#include <sys/limits.h> 36#include <sys/lock.h> 37#include <sys/mutex.h> 38#include <sys/kernel.h> --- 12 unchanged lines hidden (view full) --- 51#include <net/route.h> 52#include <net/vnet.h> 53 54static void if_clone_free(struct if_clone *ifc); 55static int if_clone_createif(struct if_clone *ifc, char *name, size_t len, 56 caddr_t params); 57 58static struct mtx if_cloners_mtx; |
59STATIC_VNET_DEFINE(int, if_cloners_count); | 59static VNET_DEFINE(int, if_cloners_count); |
60VNET_DEFINE(LIST_HEAD(, if_clone), if_cloners); 61 62#define V_if_cloners_count VNET(if_cloners_count) 63#define V_if_cloners VNET(if_cloners) 64 65#define IF_CLONERS_LOCK_INIT() \ 66 mtx_init(&if_cloners_mtx, "if_cloners lock", NULL, MTX_DEF) 67#define IF_CLONERS_LOCK_ASSERT() mtx_assert(&if_cloners_mtx, MA_OWNED) --- 548 unchanged lines hidden --- | 60VNET_DEFINE(LIST_HEAD(, if_clone), if_cloners); 61 62#define V_if_cloners_count VNET(if_cloners_count) 63#define V_if_cloners VNET(if_cloners) 64 65#define IF_CLONERS_LOCK_INIT() \ 66 mtx_init(&if_cloners_mtx, "if_cloners lock", NULL, MTX_DEF) 67#define IF_CLONERS_LOCK_ASSERT() mtx_assert(&if_cloners_mtx, MA_OWNED) --- 548 unchanged lines hidden --- |