Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/share/man/man9 Fix example code and emphasize it doesn't han...
details: https://anonhg.NetBSD.org/src/rev/c20950f41a66
branches: trunk
changeset: 337029:c20950f41a66
user: riastradh <riastradh%NetBSD.org@localhost>
date: Mon Mar 30 13:58:03 2015 +0000
description:
Fix example code and emphasize it doesn't handle holes.
diffstat:
share/man/man9/bufferio.9 | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
diffs (29 lines):
diff -r 48cabf7b9323 -r c20950f41a66 share/man/man9/bufferio.9
--- a/share/man/man9/bufferio.9 Mon Mar 30 13:51:42 2015 +0000
+++ b/share/man/man9/bufferio.9 Mon Mar 30 13:58:03 2015 +0000
@@ -1,4 +1,4 @@
-.\" $NetBSD: bufferio.9,v 1.12 2015/03/30 13:40:01 riastradh Exp $
+.\" $NetBSD: bufferio.9,v 1.13 2015/03/30 13:58:03 riastradh Exp $
.\"
.\" Copyright (c) 2015 The NetBSD Foundation, Inc.
.\" All rights reserved.
@@ -235,7 +235,8 @@
mbp->b_resid = mbp->b_bcount = datalen;
mbp->b_flags = B_WRITE;
-KASSERT(i < nsegs);
+KASSERT(0 < nsegs);
+KASSERT(datalen == nsegs*segsz);
for (i = 0; i < nsegs; i++) {
struct vnode *devvp;
daddr_t blkno;
@@ -246,7 +247,8 @@
if (error == 0 && nbn == -1)
error = EIO;
if (error) {
- skipped += segsz;
+ /* Give up early, don't try to handle holes. */
+ skipped += datalen - i*segsz;
break;
}
Home |
Main Index |
Thread Index |
Old Index