From owner-svn-src-head@FreeBSD.ORG Sun May 31 20:18:07 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 442F710656FF; Sun, 31 May 2009 20:18:07 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 266A38FC14; Sun, 31 May 2009 20:18:03 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n4VKI3bn053904; Sun, 31 May 2009 20:18:03 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n4VKI21g053901; Sun, 31 May 2009 20:18:02 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <200905312018.n4VKI21g053901@svn.freebsd.org> From: Alan Cox Date: Sun, 31 May 2009 20:18:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r193187 - in head/sys: fs/nfsclient kern nfsclient sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 31 May 2009 20:18:08 -0000 Author: alc Date: Sun May 31 20:18:02 2009 New Revision: 193187 URL: http://svn.freebsd.org/changeset/base/193187 Log: nfs_write() can use the recently introduced vfs_bio_set_valid() instead of vfs_bio_set_validclean(), thereby avoiding the page queues lock. Garbage collect vfs_bio_set_validclean(). Nothing uses it any longer. Modified: head/sys/fs/nfsclient/nfs_clbio.c head/sys/kern/vfs_bio.c head/sys/nfsclient/nfs_bio.c head/sys/sys/buf.h Modified: head/sys/fs/nfsclient/nfs_clbio.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clbio.c Sun May 31 20:16:06 2009 (r193186) +++ head/sys/fs/nfsclient/nfs_clbio.c Sun May 31 20:18:02 2009 (r193187) @@ -1302,7 +1302,7 @@ again: bp->b_dirtyoff = on; bp->b_dirtyend = on + n; } - vfs_bio_set_validclean(bp, on, n); + vfs_bio_set_valid(bp, on, n); } /* Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Sun May 31 20:16:06 2009 (r193186) +++ head/sys/kern/vfs_bio.c Sun May 31 20:18:02 2009 (r193187) @@ -3673,47 +3673,6 @@ vfs_bio_set_valid(struct buf *bp, int ba } /* - * vfs_bio_set_validclean: - * - * Set the range within the buffer to valid and clean. The range is - * relative to the beginning of the buffer, b_offset. Note that b_offset - * itself may be offset from the beginning of the first page. - * - */ - -void -vfs_bio_set_validclean(struct buf *bp, int base, int size) -{ - int i, n; - vm_page_t m; - - if (!(bp->b_flags & B_VMIO)) - return; - /* - * Fixup base to be relative to beginning of first page. - * Set initial n to be the maximum number of bytes in the - * first page that can be validated. - */ - - base += (bp->b_offset & PAGE_MASK); - n = PAGE_SIZE - (base & PAGE_MASK); - - VM_OBJECT_LOCK(bp->b_bufobj->bo_object); - vm_page_lock_queues(); - for (i = base / PAGE_SIZE; size > 0 && i < bp->b_npages; ++i) { - m = bp->b_pages[i]; - if (n > size) - n = size; - vm_page_set_validclean(m, base & PAGE_MASK, n); - base += n; - size -= n; - n = PAGE_SIZE; - } - vm_page_unlock_queues(); - VM_OBJECT_UNLOCK(bp->b_bufobj->bo_object); -} - -/* * vfs_bio_clrbuf: * * If the specified buffer is a non-VMIO buffer, clear the entire Modified: head/sys/nfsclient/nfs_bio.c ============================================================================== --- head/sys/nfsclient/nfs_bio.c Sun May 31 20:16:06 2009 (r193186) +++ head/sys/nfsclient/nfs_bio.c Sun May 31 20:18:02 2009 (r193187) @@ -1200,7 +1200,7 @@ again: bp->b_dirtyoff = on; bp->b_dirtyend = on + n; } - vfs_bio_set_validclean(bp, on, n); + vfs_bio_set_valid(bp, on, n); } /* Modified: head/sys/sys/buf.h ============================================================================== --- head/sys/sys/buf.h Sun May 31 20:16:06 2009 (r193186) +++ head/sys/sys/buf.h Sun May 31 20:18:02 2009 (r193187) @@ -499,7 +499,6 @@ int cluster_read(struct vnode *, u_quad_ int cluster_wbuild(struct vnode *, long, daddr_t, int); void cluster_write(struct vnode *, struct buf *, u_quad_t, int); void vfs_bio_set_valid(struct buf *, int base, int size); -void vfs_bio_set_validclean(struct buf *, int base, int size); void vfs_bio_clrbuf(struct buf *); void vfs_busy_pages(struct buf *, int clear_modify); void vfs_unbusy_pages(struct buf *);