On Tue, Nov 27, 2012 at 22:17 +0100, Mike Belopuhov wrote:
> apparently it works just fine. the number of clones is limited
> by the v_specbitmap which currently allows for 64 clones total
> (per system, not per process).
>
> apply the diff and see how all your apps are happily using single
> device node: /dev/bpf0.
>
> thanks to pedro and thib for the spec_open_clone and guenther
> for helping out big time.
>
> i'm not 100% sure we want this but why wouldn't we?
> generally speaking we also need to move to a single /dev/bpf
> node, but that can be done, once this diff is tested and we all
> agree that this is a way to go.
>
> so please test and share your thoughts.
>
for those who wants to have lots of (1024) nodes available:
diff --git sys/sys/conf.h sys/sys/conf.h
index b2ee90c..46937fd 100644
--- sys/sys/conf.h
+++ sys/sys/conf.h
@@ -313,7 +313,7 @@ extern struct cdevsw cdevsw[];
dev_init(c,n,open), dev_init(c,n,close), dev_init(c,n,read), \
dev_init(c,n,write), dev_init(c,n,ioctl), (dev_type_stop((*))) enodev, \
0, dev_init(c,n,poll), (dev_type_mmap((*))) enodev, \
- 0, 0, dev_init(c,n,kqfilter) }
+ 0, D_CLONE, dev_init(c,n,kqfilter) }
/* open, close, ioctl */
#define cdev_lkm_init(c,n) { \
diff --git sys/sys/specdev.h sys/sys/specdev.h
index 4341a35..1801d9a 100644
--- sys/sys/specdev.h
+++ sys/sys/specdev.h
@@ -46,7 +46,7 @@ struct specinfo {
daddr64_t si_lastr;
union {
struct vnode *ci_parent; /* pointer back to parent device */
- u_int8_t ci_bitmap[8]; /* bitmap of devices cloned off us */
+ u_int8_t ci_bitmap[128]; /* bitmap of devices cloned off us */
} si_ci;
};