Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/raidframe use bdev_strategy wrapper to properly use ...



details:   https://anonhg.NetBSD.org/src/rev/0f8e90878078
branches:  trunk
changeset: 342629:0f8e90878078
user:      mlelstv <mlelstv%NetBSD.org@localhost>
date:      Sat Jan 02 16:00:01 2016 +0000

description:
use bdev_strategy wrapper to properly use KERNEL_LOCK.

diffstat:

 sys/dev/raidframe/rf_netbsdkintf.c |  17 ++++-------------
 1 files changed, 4 insertions(+), 13 deletions(-)

diffs (59 lines):

diff -r 1ed6172bc5e1 -r 0f8e90878078 sys/dev/raidframe/rf_netbsdkintf.c
--- a/sys/dev/raidframe/rf_netbsdkintf.c        Sat Jan 02 12:11:30 2016 +0000
+++ b/sys/dev/raidframe/rf_netbsdkintf.c        Sat Jan 02 16:00:01 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rf_netbsdkintf.c,v 1.330 2015/12/26 21:50:43 pgoyette Exp $    */
+/*     $NetBSD: rf_netbsdkintf.c,v 1.331 2016/01/02 16:00:01 mlelstv Exp $     */
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2008-2011 The NetBSD Foundation, Inc.
@@ -101,7 +101,7 @@
  ***********************************************************/
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.330 2015/12/26 21:50:43 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.331 2016/01/02 16:00:01 mlelstv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -2643,7 +2643,6 @@
     size_t msize, daddr_t offset, daddr_t dsize)
 {
        struct buf *bp;
-       const struct bdevsw *bdev;
        int error;
 
        /* XXX should probably ensure that we don't try to do this if
@@ -2665,11 +2664,7 @@
        bp->b_flags |= B_READ;
        bp->b_resid = dsize;
 
-       bdev = bdevsw_lookup(bp->b_dev);
-       if (bdev == NULL)
-               return (ENXIO);
-       (*bdev->d_strategy)(bp);
-
+       bdev_strategy(bp);
        error = biowait(bp);
 
        if (!error) {
@@ -2697,7 +2692,6 @@
     size_t msize, daddr_t offset, daddr_t dsize, int asyncp)
 {
        struct buf *bp;
-       const struct bdevsw *bdev;
        int error;
 
        /* get a block of the appropriate size... */
@@ -2713,10 +2707,7 @@
        memset(bp->b_data, 0, dsize);
        memcpy(bp->b_data, data, msize);
 
-       bdev = bdevsw_lookup(bp->b_dev);
-       if (bdev == NULL)
-               return (ENXIO);
-       (*bdev->d_strategy)(bp);
+       bdev_strategy(bp);
        if (asyncp)
                return 0;
        error = biowait(bp);



Home | Main Index | Thread Index | Old Index