From owner-svn-src-user@FreeBSD.ORG Thu Nov 19 05:03:38 2009 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1671B1065672; Thu, 19 Nov 2009 05:03:38 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E0D358FC15; Thu, 19 Nov 2009 05:03:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAJ53bod094277; Thu, 19 Nov 2009 05:03:37 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAJ53bEi094275; Thu, 19 Nov 2009 05:03:37 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200911190503.nAJ53bEi094275@svn.freebsd.org> From: Kip Macy Date: Thu, 19 Nov 2009 05:03:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199506 - user/kmacy/releng_8_fcs_buf/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Nov 2009 05:03:38 -0000 Author: kmacy Date: Thu Nov 19 05:03:37 2009 New Revision: 199506 URL: http://svn.freebsd.org/changeset/base/199506 Log: - simplify arc_brelvp to always invalidate - call at the start of arc_write_done 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 Thu Nov 19 04:47:43 2009 (r199505) +++ user/kmacy/releng_8_fcs_buf/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Thu Nov 19 05:03:37 2009 (r199506) @@ -1322,14 +1322,8 @@ arc_brelvp(arc_buf_hdr_t *hdr) */ BUF_LOCK(bp, LK_EXCLUSIVE | LK_INTERLOCK, BO_MTX(bo)); bremfree(bp); - /* - * buffer is not valid or is older - */ - if (((bp->b_flags & (B_CACHE|B_INVAL)) != B_CACHE) || - (bp->b_birth <= hdr->b_birth)) { - bp->b_flags |= B_INVAL; - bp->b_birth = 0; - } + bp->b_flags |= B_INVAL; + bp->b_birth = 0; brelse(bp); } else BO_UNLOCK(bo); @@ -3411,6 +3405,8 @@ arc_write_done(zio_t *zio) hdr->b_dva = *BP_IDENTITY(zio->io_bp); hdr->b_birth = zio->io_bp->blk_birth; hdr->b_cksum0 = zio->io_bp->blk_cksum.zc_word[0]; + arc_brelvp(hdr); + /* * If the block to be written was all-zero, we may have * compressed it away. In this case no write was performed @@ -3452,8 +3448,6 @@ arc_write_done(zio_t *zio) exists = buf_hash_insert(hdr, &hash_lock); ASSERT3P(exists, ==, NULL); } else if (buf->b_bp != NULL) { - arc_brelvp(hdr); - buf->b_bp->b_flags |= B_CACHE; buf->b_bp->b_flags &= ~B_INVAL; } @@ -3469,7 +3463,6 @@ arc_write_done(zio_t *zio) * This is an anonymous buffer with no user callback, * destroy it if there are no active references. */ - arc_brelvp(hdr); mutex_enter(&arc_eviction_mtx); destroy_hdr = refcount_is_zero(&hdr->b_refcnt); hdr->b_flags &= ~ARC_IO_IN_PROGRESS; @@ -3478,7 +3471,6 @@ arc_write_done(zio_t *zio) arc_hdr_destroy(hdr); } else { hdr->b_flags &= ~ARC_IO_IN_PROGRESS; - arc_brelvp(hdr); } hdr->b_flags &= ~ARC_STORED;