* use pseudo-device <dev> <n> in the kernel config to specify
the number of devices to precreate (<n>) for snp, tun, vn, bpf.
* The full rationale (for vn, snp, bpf and tun) is:
- if NO pseudo-device foo is specified, 4 devices will be
precreated.
- if pseudo-device foo is specified, 4 devices will be
precreated.
- if pseudo-device foo N, where N > 1 is specified, N devices
will be precreated.
* NOTE 2: Doesn't interact with leases, should it?
*/
+#include "use_vn.h"
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
static d_clone_t vnclone;
DEVFS_DECLARE_CLONE_BITMAP(vn);
+
+#if NVN <= 1
#define VN_PREALLOCATED_UNITS 4
+#else
+#define VN_PREALLOCATED_UNITS NVN
+#endif
#define CDEV_MAJOR 43
* $DragonFly: src/sys/dev/misc/snp/snp.c,v 1.19 2007/05/08 02:31:41 dillon Exp $
*/
+#include "use_snp.h"
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/filio.h>
static d_poll_t snppoll;
static d_clone_t snpclone;
DEVFS_DECLARE_CLONE_BITMAP(snp);
+
+#if NSNP <= 1
#define SNP_PREALLOCATED_UNITS 4
+#else
+#define SNP_PREALLOCATED_UNITS NSNP
+#endif
#define CDEV_MAJOR 53
static struct dev_ops snp_ops = {
MALLOC_DEFINE(M_BPF, "BPF", "BPF data");
DEVFS_DECLARE_CLONE_BITMAP(bpf);
+
+#if NBPF <= 1
#define BPF_PREALLOCATED_UNITS 4
+#else
+#define BPF_PREALLOCATED_UNITS NBPF
+#endif
#if NBPF > 0
* $DragonFly: src/sys/net/tun/if_tun.c,v 1.37 2008/06/05 18:06:32 swildner Exp $
*/
+#include "use_tun.h"
#include "opt_atalk.h"
#include "opt_inet.h"
#include "opt_inet6.h"
static d_clone_t tunclone;
DEVFS_DECLARE_CLONE_BITMAP(tun);
+
+#if NTUN <= 1
#define TUN_PREALLOCATED_UNITS 4
+#else
+#define TUN_PREALLOCATED_UNITS NTUN
+#endif
#define CDEV_MAJOR 52
static struct dev_ops tun_ops = {