Module Name:    src
Committed By:   bouyer
Date:           Fri Jul 21 11:28:50 UTC 2023

Modified Files:
        src/sys/arch/xen/xen: xbd_xenbus.c

Log Message:
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


To generate a diff of this commit:
cvs rdiff -u -r1.132 -r1.133 src/sys/arch/xen/xen/xbd_xenbus.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/xen/xen/xbd_xenbus.c
diff -u src/sys/arch/xen/xen/xbd_xenbus.c:1.132 src/sys/arch/xen/xen/xbd_xenbus.c:1.133
--- src/sys/arch/xen/xen/xbd_xenbus.c:1.132	Fri Jul 21 11:21:55 2023
+++ src/sys/arch/xen/xen/xbd_xenbus.c	Fri Jul 21 11:28:50 2023
@@ -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);

Reply via email to