Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/xen/xen Also use XEN_BSIZE when computing the numbe...



details:   https://anonhg.NetBSD.org/src/rev/ed7b96ef7fc5
branches:  trunk
changeset: 378131:ed7b96ef7fc5
user:      bouyer <bouyer%NetBSD.org@localhost>
date:      Fri Jul 21 11:28:50 2023 +0000

description:
Also use XEN_BSIZE when computing the number of bytes for format_bytes().
While there note in a comment that sc_sectors is in XEN_BSIZE units

diffstat:

 sys/arch/xen/xen/xbd_xenbus.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (36 lines):

diff -r 7ff4d00bbfcd -r ed7b96ef7fc5 sys/arch/xen/xen/xbd_xenbus.c
--- a/sys/arch/xen/xen/xbd_xenbus.c     Fri Jul 21 11:26:23 2023 +0000
+++ b/sys/arch/xen/xen/xbd_xenbus.c     Fri Jul 21 11:28:50 2023 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: xbd_xenbus.c,v 1.132 2023/07/21 11:21:55 bouyer Exp $      */
+/*      $NetBSD: xbd_xenbus.c,v 1.133 2023/07/21 11:28:50 bouyer Exp $      */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -50,7 +50,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: xbd_xenbus.c,v 1.132 2023/07/21 11:21:55 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xbd_xenbus.c,v 1.133 2023/07/21 11:28:50 bouyer Exp $");
 
 #include "opt_xen.h"
 
@@ -169,7 +169,7 @@ struct xbd_xenbus_softc {
 #define BLKIF_SHUTDOWN_REMOTE 1 /* backend-initiated shutdown in progress */
 #define BLKIF_SHUTDOWN_LOCAL  2 /* locally-initiated shutdown in progress */
 
-       uint64_t sc_sectors; /* number of sectors for this device */
+       uint64_t sc_sectors; /* number of XEN_BSIZE sectors for this device */
        u_long sc_secsize; /* sector size */
        uint64_t sc_xbdsize; /* size of disk in DEV_BSIZE */
        u_long sc_info; /* VDISK_* */
@@ -693,7 +693,7 @@ xbd_backend_changed(void *arg, XenbusSta
                hypervisor_unmask_event(sc->sc_evtchn);
 
                format_bytes(buf, uimin(9, sizeof(buf)),
-                   sc->sc_sectors * sc->sc_secsize);
+                   sc->sc_sectors * XEN_BSIZE);
                aprint_normal_dev(sc->sc_dksc.sc_dev,
                                "%s, %d bytes/sect x %" PRIu64 " sectors\n",
                                buf, (int)dg->dg_secsize, sc->sc_xbdsize);



Home | Main Index | Thread Index | Old Index