Deleted Added
full compact
uipc_usrreq.c (157370) uipc_usrreq.c (157927)
1/*-
2 * Copyright (c) 1982, 1986, 1989, 1991, 1993
3 * The Regents of the University of California.
4 * Copyright 2004-2006 Robert N. M. Watson
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

--- 18 unchanged lines hidden (view full) ---

27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29 * SUCH DAMAGE.
30 *
31 * From: @(#)uipc_usrreq.c 8.3 (Berkeley) 1/4/94
32 */
33
34#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 1982, 1986, 1989, 1991, 1993
3 * The Regents of the University of California.
4 * Copyright 2004-2006 Robert N. M. Watson
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

--- 18 unchanged lines hidden (view full) ---

27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29 * SUCH DAMAGE.
30 *
31 * From: @(#)uipc_usrreq.c 8.3 (Berkeley) 1/4/94
32 */
33
34#include <sys/cdefs.h>
35__FBSDID("$FreeBSD: head/sys/kern/uipc_usrreq.c 157370 2006-04-01 15:42:02Z rwatson $");
35__FBSDID("$FreeBSD: head/sys/kern/uipc_usrreq.c 157927 2006-04-21 09:25:40Z ps $");
36
37#include "opt_mac.h"
38
39#include <sys/param.h>
40#include <sys/domain.h>
41#include <sys/fcntl.h>
42#include <sys/malloc.h> /* XXX must be before <sys/file.h> */
36
37#include "opt_mac.h"
38
39#include <sys/param.h>
40#include <sys/domain.h>
41#include <sys/fcntl.h>
42#include <sys/malloc.h> /* XXX must be before <sys/file.h> */
43#include <sys/eventhandler.h>
43#include <sys/file.h>
44#include <sys/filedesc.h>
45#include <sys/jail.h>
46#include <sys/kernel.h>
47#include <sys/lock.h>
48#include <sys/mac.h>
49#include <sys/mbuf.h>
50#include <sys/mount.h>

--- 1269 unchanged lines hidden (view full) ---

1320 }
1321 }
1322
1323 m_freem(control);
1324
1325 return (error);
1326}
1327
44#include <sys/file.h>
45#include <sys/filedesc.h>
46#include <sys/jail.h>
47#include <sys/kernel.h>
48#include <sys/lock.h>
49#include <sys/mac.h>
50#include <sys/mbuf.h>
51#include <sys/mount.h>

--- 1269 unchanged lines hidden (view full) ---

1321 }
1322 }
1323
1324 m_freem(control);
1325
1326 return (error);
1327}
1328
1329static void
1330unp_zone_change(void *tag)
1331{
1332
1333 uma_zone_set_max(unp_zone, maxsockets);
1334}
1335
1328void
1329unp_init(void)
1330{
1331 unp_zone = uma_zcreate("unpcb", sizeof(struct unpcb), NULL, NULL,
1332 NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE);
1333 if (unp_zone == NULL)
1334 panic("unp_init");
1336void
1337unp_init(void)
1338{
1339 unp_zone = uma_zcreate("unpcb", sizeof(struct unpcb), NULL, NULL,
1340 NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE);
1341 if (unp_zone == NULL)
1342 panic("unp_init");
1335 uma_zone_set_max(unp_zone, nmbclusters);
1343 uma_zone_set_max(unp_zone, maxsockets);
1344 EVENTHANDLER_REGISTER(maxsockets_change, unp_zone_change,
1345 NULL, EVENTHANDLER_PRI_ANY);
1336 LIST_INIT(&unp_dhead);
1337 LIST_INIT(&unp_shead);
1338 TASK_INIT(&unp_gc_task, 0, unp_gc, NULL);
1339 UNP_LOCK_INIT();
1340}
1341
1342static int
1343unp_internalize(struct mbuf **controlp, struct thread *td)

--- 483 unchanged lines hidden ---
1346 LIST_INIT(&unp_dhead);
1347 LIST_INIT(&unp_shead);
1348 TASK_INIT(&unp_gc_task, 0, unp_gc, NULL);
1349 UNP_LOCK_INIT();
1350}
1351
1352static int
1353unp_internalize(struct mbuf **controlp, struct thread *td)

--- 483 unchanged lines hidden ---