From owner-svn-src-all@FreeBSD.ORG Thu Mar 29 09:16:11 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0C26D106567C; Thu, 29 Mar 2012 09:16:11 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EAF228FC12; Thu, 29 Mar 2012 09:16:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2T9GA52084985; Thu, 29 Mar 2012 09:16:10 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2T9GA4c084983; Thu, 29 Mar 2012 09:16:10 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201203290916.q2T9GA4c084983@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 29 Mar 2012 09:16:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233653 - stable/9/sys/ufs/ffs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Mar 2012 09:16:11 -0000 Author: kib Date: Thu Mar 29 09:16:10 2012 New Revision: 233653 URL: http://svn.freebsd.org/changeset/base/233653 Log: MFC r232835: Do not fall back to slow synchronous i/o when low on memory or buffers. The bawrite() schedules the write to happen immediately, and its use frees the current thread to do more cleanups. MFC r232837: Remove superfluous brackets. Modified: stable/9/sys/ufs/ffs/ffs_inode.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/ufs/ffs/ffs_inode.c ============================================================================== --- stable/9/sys/ufs/ffs/ffs_inode.c Thu Mar 29 07:29:27 2012 (r233652) +++ stable/9/sys/ufs/ffs/ffs_inode.c Thu Mar 29 09:16:10 2012 (r233653) @@ -148,9 +148,11 @@ loop: else *((struct ufs2_dinode *)bp->b_data + ino_to_fsbo(fs, ip->i_number)) = *ip->i_din2; - if ((waitfor && !DOINGASYNC(vp)) || - (vm_page_count_severe() || buf_dirty_count_severe())) { + if (waitfor && !DOINGASYNC(vp)) error = bwrite(bp); + else if (vm_page_count_severe() || buf_dirty_count_severe()) { + bawrite(bp); + error = 0; } else { if (bp->b_bufsize == fs->fs_bsize) bp->b_flags |= B_CLUSTEROK;