diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2004-03-03 22:03:24 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2004-03-03 22:03:24 +0000 |
commit | b339c2abb045122f7790fdddfdeb02606db805d9 (patch) | |
tree | 087ee3c17112e5178507460b4f7d84dd3e7a45d9 | |
parent | b8314313ea6c9b71d895f555111d4baaa99b6dec (diff) |
Make sure than svnd read their disklabel as svnd, not vnd devices.
ok tedu@
-rw-r--r-- | sys/dev/vnd.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/dev/vnd.c b/sys/dev/vnd.c index cc9e6157e8e..1914c160534 100644 --- a/sys/dev/vnd.c +++ b/sys/dev/vnd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vnd.c,v 1.43 2004/02/15 02:52:10 tedu Exp $ */ +/* $OpenBSD: vnd.c,v 1.44 2004/03/03 22:03:23 miod Exp $ */ /* $NetBSD: vnd.c,v 1.26 1996/03/30 23:06:11 christos Exp $ */ /* @@ -100,9 +100,11 @@ int vnddebug = 0x00; */ #define vndunit(x) DISKUNIT(makedev(major(x), minor(x) & 0x7ff)) #define vndsimple(x) (minor(x) & 0x800) -#define MAKEVNDDEV(maj, unit, part) MAKEDISKDEV(maj, unit, part) -#define VNDLABELDEV(dev) (MAKEVNDDEV(major(dev), vndunit(dev), RAW_PART)) +/* same as MAKEDISKDEV, preserving the vndsimple() property */ +#define VNDLABELDEV(dev) \ + makedev(major(dev), DISKMINOR(vndunit(dev), RAW_PART) | \ + (vndsimple(dev) ? 0x800 : 0)) struct vndbuf { struct buf vb_buf; |