Wed Aug 5 14:37:02 2009 UTC ()
remember to nestiobuf_done() too


(pooka)
diff -r1.275 -r1.276 src/sys/ufs/lfs/lfs_vfsops.c

cvs diff -r1.275 -r1.276 src/sys/ufs/lfs/lfs_vfsops.c (expand / switch to unified diff)

--- src/sys/ufs/lfs/lfs_vfsops.c 2009/08/05 14:09:26 1.275
+++ src/sys/ufs/lfs/lfs_vfsops.c 2009/08/05 14:37:01 1.276
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: lfs_vfsops.c,v 1.275 2009/08/05 14:09:26 pooka Exp $ */ 1/* $NetBSD: lfs_vfsops.c,v 1.276 2009/08/05 14:37:01 pooka Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 1999, 2000, 2001, 2002, 2003, 2007, 2007 4 * Copyright (c) 1999, 2000, 2001, 2002, 2003, 2007, 2007
5 * The NetBSD Foundation, Inc. 5 * The NetBSD Foundation, Inc.
6 * All rights reserved. 6 * All rights reserved.
7 * 7 *
8 * This code is derived from software contributed to The NetBSD Foundation 8 * This code is derived from software contributed to The NetBSD Foundation
9 * by Konrad E. Schroder <perseant@hhhh.org>. 9 * by Konrad E. Schroder <perseant@hhhh.org>.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions 12 * modification, are permitted provided that the following conditions
13 * are met: 13 * are met:
14 * 1. Redistributions of source code must retain the above copyright 14 * 1. Redistributions of source code must retain the above copyright
@@ -51,27 +51,27 @@ @@ -51,27 +51,27 @@
51 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 51 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
52 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 52 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
53 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 53 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
54 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 54 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
55 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 55 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
56 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 56 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
57 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 57 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
58 * SUCH DAMAGE. 58 * SUCH DAMAGE.
59 * 59 *
60 * @(#)lfs_vfsops.c 8.20 (Berkeley) 6/10/95 60 * @(#)lfs_vfsops.c 8.20 (Berkeley) 6/10/95
61 */ 61 */
62 62
63#include <sys/cdefs.h> 63#include <sys/cdefs.h>
64__KERNEL_RCSID(0, "$NetBSD: lfs_vfsops.c,v 1.275 2009/08/05 14:09:26 pooka Exp $"); 64__KERNEL_RCSID(0, "$NetBSD: lfs_vfsops.c,v 1.276 2009/08/05 14:37:01 pooka Exp $");
65 65
66#if defined(_KERNEL_OPT) 66#if defined(_KERNEL_OPT)
67#include "opt_lfs.h" 67#include "opt_lfs.h"
68#include "opt_quota.h" 68#include "opt_quota.h"
69#endif 69#endif
70 70
71#include <sys/param.h> 71#include <sys/param.h>
72#include <sys/systm.h> 72#include <sys/systm.h>
73#include <sys/namei.h> 73#include <sys/namei.h>
74#include <sys/proc.h> 74#include <sys/proc.h>
75#include <sys/kernel.h> 75#include <sys/kernel.h>
76#include <sys/vnode.h> 76#include <sys/vnode.h>
77#include <sys/mount.h> 77#include <sys/mount.h>
@@ -1765,37 +1765,29 @@ lfs_gop_write(struct vnode *vp, struct v @@ -1765,37 +1765,29 @@ lfs_gop_write(struct vnode *vp, struct v
1765 mutex_exit(&vp->v_interlock); 1765 mutex_exit(&vp->v_interlock);
1766 mutex_exit(&bufcache_lock); 1766 mutex_exit(&bufcache_lock);
1767 1767
1768 bp->b_lblkno = lblkno(fs, offset); 1768 bp->b_lblkno = lblkno(fs, offset);
1769 bp->b_private = mbp; 1769 bp->b_private = mbp;
1770 if (devvp->v_type == VBLK) { 1770 if (devvp->v_type == VBLK) {
1771 bp->b_dev = devvp->v_rdev; 1771 bp->b_dev = devvp->v_rdev;
1772 } 1772 }
1773 VOP_BWRITE(bp); 1773 VOP_BWRITE(bp);
1774 while (lfs_gatherblock(sp, bp, NULL)) 1774 while (lfs_gatherblock(sp, bp, NULL))
1775 continue; 1775 continue;
1776 } 1776 }
1777 1777
 1778 nestiobuf_done(mbp, skipbytes, error);
1778 if (skipbytes) { 1779 if (skipbytes) {
1779 UVMHIST_LOG(ubchist, "skipbytes %d", skipbytes, 0,0,0); 1780 UVMHIST_LOG(ubchist, "skipbytes %d", skipbytes, 0,0,0);
1780 mutex_enter(mbp->b_objlock); 
1781 if (error) { 
1782 mbp->b_error = error; 
1783 } 
1784 mbp->b_resid -= skipbytes; 
1785 mutex_exit(mbp->b_objlock); 
1786 if (mbp->b_resid == 0) { 
1787 biodone(mbp); 
1788 } 
1789 } 1781 }
1790 UVMHIST_LOG(ubchist, "returning 0", 0,0,0,0); 1782 UVMHIST_LOG(ubchist, "returning 0", 0,0,0,0);
1791 return (0); 1783 return (0);
1792 1784
1793 tryagain: 1785 tryagain:
1794 /* 1786 /*
1795 * We can't write the pages, for whatever reason. 1787 * We can't write the pages, for whatever reason.
1796 * Clean up after ourselves, and make the caller try again. 1788 * Clean up after ourselves, and make the caller try again.
1797 */ 1789 */
1798 mutex_enter(&vp->v_interlock); 1790 mutex_enter(&vp->v_interlock);
1799 1791
1800 /* Tell why we're here, if we know */ 1792 /* Tell why we're here, if we know */
1801 if (ip->i_lfs_iflags & LFSI_NO_GOP_WRITE) { 1793 if (ip->i_lfs_iflags & LFSI_NO_GOP_WRITE) {