Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/scsipi If we find a device in non-2048 byte/block mo...



details:   https://anonhg.NetBSD.org/src/rev/b6b8ab68ca28
branches:  trunk
changeset: 753350:b6b8ab68ca28
user:      martin <martin%NetBSD.org@localhost>
date:      Tue Mar 23 18:56:18 2010 +0000

description:
If we find a device in non-2048 byte/block mode and manage to switch
it over, we need to adjust the capacity - so just read it again.

diffstat:

 sys/dev/scsipi/cd.c |  11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diffs (33 lines):

diff -r c92afbda9025 -r b6b8ab68ca28 sys/dev/scsipi/cd.c
--- a/sys/dev/scsipi/cd.c       Tue Mar 23 18:09:16 2010 +0000
+++ b/sys/dev/scsipi/cd.c       Tue Mar 23 18:56:18 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cd.c,v 1.300 2010/03/23 12:42:55 martin Exp $  */
+/*     $NetBSD: cd.c,v 1.301 2010/03/23 18:56:18 martin Exp $  */
 
 /*-
  * Copyright (c) 1998, 2001, 2003, 2004, 2005, 2008 The NetBSD Foundation,
@@ -50,7 +50,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cd.c,v 1.300 2010/03/23 12:42:55 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cd.c,v 1.301 2010/03/23 18:56:18 martin Exp $");
 
 #include "rnd.h"
 
@@ -1881,8 +1881,13 @@
                return size;
 
        if (blksize != 2048) {
-               if (cd_setblksize(cd) == 0)
+               if (cd_setblksize(cd) == 0) {
                        blksize = 2048;
+                       error = read_cd_capacity(cd->sc_periph,
+                           &blksize, &size);
+                       if (error)
+                               return size;
+               }
        }
        cd->params.blksize     = blksize;
        cd->params.disksize    = size;



Home | Main Index | Thread Index | Old Index