Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/dkwedge fix iobuf setup, cleanup



details:   https://anonhg.NetBSD.org/src/rev/9172760f724d
branches:  trunk
changeset: 804064:9172760f724d
user:      mlelstv <mlelstv%NetBSD.org@localhost>
date:      Sat Nov 22 11:59:33 2014 +0000

description:
fix iobuf setup, cleanup

diffstat:

 sys/dev/dkwedge/dk.c |  15 +++++++++------
 1 files changed, 9 insertions(+), 6 deletions(-)

diffs (57 lines):

diff -r 8dcfa6f48788 -r 9172760f724d sys/dev/dkwedge/dk.c
--- a/sys/dev/dkwedge/dk.c      Sat Nov 22 11:10:22 2014 +0000
+++ b/sys/dev/dkwedge/dk.c      Sat Nov 22 11:59:33 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: dk.c,v 1.74 2014/11/04 07:50:39 mlelstv Exp $  */
+/*     $NetBSD: dk.c,v 1.75 2014/11/22 11:59:33 mlelstv Exp $  */
 
 /*-
  * Copyright (c) 2004, 2005, 2006, 2007 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dk.c,v 1.74 2014/11/04 07:50:39 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dk.c,v 1.75 2014/11/22 11:59:33 mlelstv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_dkwedge.h"
@@ -217,10 +217,10 @@
                pmaj = devsw_name2chr(name, devname, sizeof(devname));
                break;
        default:
-               pmaj = -1;
+               pmaj = NODEVMAJOR;
                break;
        }
-       if (pmaj == -1)
+       if (pmaj == NODEVMAJOR)
                return (ENODEV);
 
        name += strlen(devname);
@@ -927,6 +927,7 @@
                    pdk->dk_name, error);
                /* We'll just assume the vnode has been cleaned up. */
        }
+
  out:
        rw_exit(&dkwedge_discovery_methods_lock);
 }
@@ -957,9 +958,10 @@
        bp->b_cflags = BC_BUSY;
        bp->b_dev = devsw_chr2blk(vp->v_rdev);
        bp->b_data = tbuf;
-       bp->b_bufsize = bp->b_resid = bp->b_bcount = len;
-       bp->b_lblkno = 0;
+       bp->b_bufsize = bp->b_bcount = len;
        bp->b_blkno = blkno;
+       bp->b_cylinder = 0;
+       bp->b_error = 0;
 
        error = bdev_open(bp->b_dev, FREAD, S_IFBLK, curlwp);
        if (error)
@@ -1570,3 +1572,4 @@
                return NULL;
        return sc->sc_parent->dk_name;
 }
+



Home | Main Index | Thread Index | Old Index