Date: Sun, 1 Nov 2009 23:59:23 +0000 (UTC) From: Kip Macy <kmacy@FreeBSD.org> To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r198777 - user/kmacy/releng_8_fcs_buf/sys/cddl/contrib/opensolaris/uts/common/fs/zfs Message-ID: <200911012359.nA1NxN2Y038966@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: kmacy Date: Sun Nov 1 23:59:23 2009 New Revision: 198777 URL: http://svn.freebsd.org/changeset/base/198777 Log: if a block is already cached we need to free the corresponding buffer 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 21:48:18 2009 (r198776) +++ user/kmacy/releng_8_fcs_buf/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Sun Nov 1 23:59:23 2009 (r198777) @@ -3357,14 +3357,21 @@ arc_write_done(zio_t *zio) ASSERT3P(exists, ==, NULL); } else if ((hdr->b_buf == buf) && (bp->b_bufobj == NULL)) { + struct buf *oldbp; + struct bufobj *bo; - bp->b_bufobj = &vp->v_bufobj; + oldbp = getblk(vp, blkno, bp->b_bcount, 0, 0, GB_NOCREAT); + if (oldbp != NULL) { + oldbp->b_flags |= B_INVAL; + brelse(oldbp); + } + bo = bp->b_bufobj = &vp->v_bufobj; bp->b_lblkno = blkno; bp->b_blkno = blkno; bp->b_offset = (blkno << 9); - BO_LOCK(bp->b_bufobj); + BO_LOCK(bo); bgetvp(vp, bp); - BO_UNLOCK(bp->b_bufobj); + BO_UNLOCK(bo); bp->b_flags &= ~B_INVAL; bp->b_flags |= B_CACHE; }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200911012359.nA1NxN2Y038966>