From e79a50b93f8c42873fc21b4c4a375c217446cc0d Mon Sep 17 00:00:00 2001 From: enami Date: Thu, 25 May 2000 23:28:44 +0000 Subject: [PATCH] In nfs_flush, if the previous commit succeeded and we may have more uncommitted dirty buffer, attempt to commit them. --- sys/nfs/nfs_vnops.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/sys/nfs/nfs_vnops.c b/sys/nfs/nfs_vnops.c index 9d2a63033f3d..69e4f753dec0 100644 --- a/sys/nfs/nfs_vnops.c +++ b/sys/nfs/nfs_vnops.c @@ -1,4 +1,4 @@ -/* $NetBSD: nfs_vnops.c,v 1.111 2000/03/30 13:44:53 augustss Exp $ */ +/* $NetBSD: nfs_vnops.c,v 1.112 2000/05/25 23:28:44 enami Exp $ */ /* * Copyright (c) 1989, 1993 @@ -2746,7 +2746,7 @@ nfs_flush(vp, cred, waitfor, p, commit) struct nfsmount *nmp = VFSTONFS(vp->v_mount); int s, error = 0, slptimeo = 0, slpflag = 0, retv, bvecpos; int passone = 1; - u_quad_t off = (u_quad_t)-1, endoff = 0, toff; + u_quad_t off, endoff, toff; struct ucred* wcred = NULL; #ifndef NFS_COMMITBVECSIZ #define NFS_COMMITBVECSIZ 20 @@ -2766,6 +2766,8 @@ nfs_flush(vp, cred, waitfor, p, commit) */ again: bvecpos = 0; + off = (u_quad_t)-1; + endoff = 0; if (NFS_ISV3(vp) && commit) { s = splbio(); for (bp = vp->v_dirtyblkhd.lh_first; bp; bp = nbp) { @@ -2851,6 +2853,13 @@ again: biodone(bp); } } + + /* + * If commit succeeded and we haven't walked through + * all dirty buffers, try to commit more. + */ + if (retv == 0 && bvecpos == NFS_COMMITBVECSIZ) + goto again; } /*