Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/gehenna-devsw]: src/sys/ufs Use devsw APIs for checking validity of majo...



details:   https://anonhg.NetBSD.org/src/rev/5f2b29b2e8fb
branches:  gehenna-devsw
changeset: 527031:5f2b29b2e8fb
user:      gehenna <gehenna%NetBSD.org@localhost>
date:      Thu May 16 03:48:06 2002 +0000

description:
Use devsw APIs for checking validity of major numbers.

diffstat:

 sys/ufs/ext2fs/ext2fs_vfsops.c |  7 ++++---
 sys/ufs/ffs/ffs_vfsops.c       |  7 ++++---
 sys/ufs/lfs/lfs_vfsops.c       |  7 ++++---
 3 files changed, 12 insertions(+), 9 deletions(-)

diffs (105 lines):

diff -r a812b3237aa8 -r 5f2b29b2e8fb sys/ufs/ext2fs/ext2fs_vfsops.c
--- a/sys/ufs/ext2fs/ext2fs_vfsops.c    Thu May 16 03:45:49 2002 +0000
+++ b/sys/ufs/ext2fs/ext2fs_vfsops.c    Thu May 16 03:48:06 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ext2fs_vfsops.c,v 1.49 2002/03/08 20:48:45 thorpej Exp $       */
+/*     $NetBSD: ext2fs_vfsops.c,v 1.49.6.1 2002/05/16 03:48:06 gehenna Exp $   */
 
 /*
  * Copyright (c) 1997 Manuel Bouyer.
@@ -38,7 +38,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ext2fs_vfsops.c,v 1.49 2002/03/08 20:48:45 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ext2fs_vfsops.c,v 1.49.6.1 2002/05/16 03:48:06 gehenna Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_netbsd.h"
@@ -62,6 +62,7 @@
 #include <sys/malloc.h>
 #include <sys/pool.h>
 #include <sys/lock.h>
+#include <sys/conf.h>
 
 #include <miscfs/specfs/specdev.h>
 
@@ -295,7 +296,7 @@
                vrele(devvp);
                return (ENOTBLK);
        }
-       if (major(devvp->v_rdev) >= nblkdev) {
+       if (bdevsw_lookup(devvp->v_rdev) == NULL) {
                vrele(devvp);
                return (ENXIO);
        }
diff -r a812b3237aa8 -r 5f2b29b2e8fb sys/ufs/ffs/ffs_vfsops.c
--- a/sys/ufs/ffs/ffs_vfsops.c  Thu May 16 03:45:49 2002 +0000
+++ b/sys/ufs/ffs/ffs_vfsops.c  Thu May 16 03:48:06 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ffs_vfsops.c,v 1.98 2002/04/10 08:05:13 mycroft Exp $  */
+/*     $NetBSD: ffs_vfsops.c,v 1.98.2.1 2002/05/16 03:48:07 gehenna Exp $      */
 
 /*
  * Copyright (c) 1989, 1991, 1993, 1994
@@ -36,7 +36,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ffs_vfsops.c,v 1.98 2002/04/10 08:05:13 mycroft Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ffs_vfsops.c,v 1.98.2.1 2002/05/16 03:48:07 gehenna Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_ffs.h"
@@ -64,6 +64,7 @@
 #include <sys/pool.h>
 #include <sys/lock.h>
 #include <sys/sysctl.h>
+#include <sys/conf.h>
 
 #include <miscfs/specfs/specdev.h>
 
@@ -227,7 +228,7 @@
                         */
                        if (devvp->v_type != VBLK)
                                error = ENOTBLK;
-                       else if (major(devvp->v_rdev) >= nblkdev)
+                       else if (bdevsw_lookup(devvp->v_rdev) == NULL)
                                error = ENXIO;
                } else {
                        /*
diff -r a812b3237aa8 -r 5f2b29b2e8fb sys/ufs/lfs/lfs_vfsops.c
--- a/sys/ufs/lfs/lfs_vfsops.c  Thu May 16 03:45:49 2002 +0000
+++ b/sys/ufs/lfs/lfs_vfsops.c  Thu May 16 03:48:06 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: lfs_vfsops.c,v 1.74 2002/05/14 20:03:54 perseant Exp $ */
+/*     $NetBSD: lfs_vfsops.c,v 1.74.2.1 2002/05/16 03:48:08 gehenna Exp $      */
 
 /*-
  * Copyright (c) 1999, 2000 The NetBSD Foundation, Inc.
@@ -71,7 +71,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: lfs_vfsops.c,v 1.74 2002/05/14 20:03:54 perseant Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lfs_vfsops.c,v 1.74.2.1 2002/05/16 03:48:08 gehenna Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_quota.h"
@@ -96,6 +96,7 @@
 #include <sys/socket.h>
 #include <uvm/uvm_extern.h>
 #include <sys/sysctl.h>
+#include <sys/conf.h>
 
 #include <miscfs/specfs/specdev.h>
 
@@ -293,7 +294,7 @@
                vrele(devvp);
                return (ENOTBLK);
        }
-       if (major(devvp->v_rdev) >= nblkdev) {
+       if (bdevsw_lookup(devvp->v_rdev) == NULL) {
                vrele(devvp);
                return (ENXIO);
        }



Home | Main Index | Thread Index | Old Index