Source-Changes-HG archive

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

[src/trunk]: src/sys/nfs handle partially full directory buffers by only usin...



details:   https://anonhg.NetBSD.org/src/rev/987c59cd85e1
branches:  trunk
changeset: 507947:987c59cd85e1
user:      chs <chs%NetBSD.org@localhost>
date:      Tue Apr 03 15:07:23 2001 +0000

description:
handle partially full directory buffers by only using (b_bcount - b_resid)
bytes of data from the buffer.

diffstat:

 sys/nfs/nfs_bio.c |  10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diffs (41 lines):

diff -r dd2d8811990a -r 987c59cd85e1 sys/nfs/nfs_bio.c
--- a/sys/nfs/nfs_bio.c Tue Apr 03 15:00:11 2001 +0000
+++ b/sys/nfs/nfs_bio.c Tue Apr 03 15:07:23 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nfs_bio.c,v 1.64 2001/03/10 22:46:47 chs Exp $ */
+/*     $NetBSD: nfs_bio.c,v 1.65 2001/04/03 15:07:23 chs Exp $ */
 
 /*
  * Copyright (c) 1989, 1993
@@ -333,7 +333,7 @@
                en = ndp->dc_entry;
 
                pdp = dp = (struct dirent *)bp->b_data;
-               edp = bp->b_data + bp->b_bcount;
+               edp = bp->b_data + bp->b_bcount - bp->b_resid;
                enn = 0;
                while (enn < en && (caddr_t)dp < edp) {
                        pdp = dp;
@@ -377,11 +377,11 @@
                        enn++;
                }
 
-               if (uio->uio_resid < (bp->b_bcount - on)) {
+               if (uio->uio_resid < (bp->b_bcount - bp->b_resid - on)) {
                        n = uio->uio_resid;
                        enough = 1;
                } else
-                       n = bp->b_bcount - on;
+                       n = bp->b_bcount - bp->b_resid - on;
 
                ep = bp->b_data + on + n;
 
@@ -411,7 +411,7 @@
                 * set of the offset to it.
                 */
 
-               if ((on + n) < bp->b_bcount) {
+               if ((on + n) < bp->b_bcount - bp->b_resid) {
                        curoff = NFS_GETCOOKIE(pdp);
                        nndp = nfs_enterdircache(vp, curoff, ndp->dc_blkcookie,
                            enn, bp->b_lblkno);



Home | Main Index | Thread Index | Old Index