Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 1 Nov 2009 04:43:35 +0000 (UTC)
From:      Kip Macy <kmacy@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-user@freebsd.org
Subject:   svn commit: r198739 - user/kmacy/releng_8_fcs_buf/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
Message-ID:  <200911010443.nA14hZdO013396@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kmacy
Date: Sun Nov  1 04:43:35 2009
New Revision: 198739
URL: http://svn.freebsd.org/changeset/base/198739

Log:
  don't associate a buffer with the backing vnode unless it is not present in the ARC

Modified:
  user/kmacy/releng_8_fcs_buf/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c

Modified: user/kmacy/releng_8_fcs_buf/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
==============================================================================
--- user/kmacy/releng_8_fcs_buf/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c	Sun Nov  1 04:20:06 2009	(r198738)
+++ user/kmacy/releng_8_fcs_buf/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c	Sun Nov  1 04:43:35 2009	(r198739)
@@ -3334,22 +3334,6 @@ arc_write_done(zio_t *zio)
 		CTR2(KTR_SPARE2, "arc_write_done(%p) flags %X",
 		    bp, bp->b_flags);
 
-		if ((hdr->b_buf == buf) &&
-		    (bp->b_bufobj == NULL)) {
-
-			bp->b_bufobj = &vp->v_bufobj;
-			bp->b_lblkno = blkno;
-			bp->b_blkno = blkno;
-			bp->b_offset = (blkno << 9);
-			BO_LOCK(bp->b_bufobj);
-			bgetvp(vp, bp);
-			BO_UNLOCK(bp->b_bufobj);
-			bp->b_flags &= ~B_INVAL;
-			bp->b_flags |= B_CACHE;
-		}
-
-		/*
-		 */
 		arc_cksum_verify(buf);
 
 		exists = buf_hash_insert(hdr, &hash_lock);
@@ -3371,7 +3355,20 @@ arc_write_done(zio_t *zio)
 			arc_hdr_destroy(exists);
 			exists = buf_hash_insert(hdr, &hash_lock);
 			ASSERT3P(exists, ==, NULL);
+		} else if ((hdr->b_buf == buf) &&
+		    (bp->b_bufobj == NULL)) {
+
+			bp->b_bufobj = &vp->v_bufobj;
+			bp->b_lblkno = blkno;
+			bp->b_blkno = blkno;
+			bp->b_offset = (blkno << 9);
+			BO_LOCK(bp->b_bufobj);
+			bgetvp(vp, bp);
+			BO_UNLOCK(bp->b_bufobj);
+			bp->b_flags &= ~B_INVAL;
+			bp->b_flags |= B_CACHE;
 		}
+
 		hdr->b_flags &= ~ARC_IO_IN_PROGRESS;
 		/* if it's not anon, we are doing a scrub */
 		if (hdr->b_state == arc_anon)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200911010443.nA14hZdO013396>