diff --git a/sys/vm/vm_swap.c b/sys/vm/vm_swap.c index 4fc57a0cfea1..bafe434a0334 100644 --- a/sys/vm/vm_swap.c +++ b/sys/vm/vm_swap.c @@ -49,6 +49,7 @@ #include #include #include +#include #include #include #include @@ -63,13 +64,14 @@ * provided as a character (raw) device. */ +static d_open_t swopen; static d_strategy_t swstrategy; #define CDEV_MAJOR 4 #define BDEV_MAJOR 26 static struct cdevsw sw_cdevsw = { - /* open */ nullopen, + /* open */ swopen, /* close */ nullclose, /* read */ physread, /* write */ physwrite, @@ -108,6 +110,20 @@ int vm_swap_size; * The bp is expected to be locked and *not* B_DONE on call. */ +static int +swopen(dev, flag, mode, p) + dev_t dev; + int flag; + int mode; + struct proc *p; +{ + + if (mode == S_IFBLK || minor(dev)) + return (ENXIO); + return (0); +} + + static void swstrategy(bp) register struct buf *bp;