From owner-svn-src-all@freebsd.org Wed Dec 9 22:37:24 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AECFC4B1A05; Wed, 9 Dec 2020 22:37:24 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CrsPJ4Wdyz4SF8; Wed, 9 Dec 2020 22:37:24 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 89AC55FA5; Wed, 9 Dec 2020 22:37:24 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0B9MbOkW074994; Wed, 9 Dec 2020 22:37:24 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0B9MbO1B074992; Wed, 9 Dec 2020 22:37:24 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <202012092237.0B9MbO1B074992@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Wed, 9 Dec 2020 22:37:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r368494 - in stable/12/sys: fs/ext2fs ufs/ufs X-SVN-Group: stable-12 X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: in stable/12/sys: fs/ext2fs ufs/ufs X-SVN-Commit-Revision: 368494 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.34 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: Wed, 09 Dec 2020 22:37:24 -0000 Author: mckusick Date: Wed Dec 9 22:37:23 2020 New Revision: 368494 URL: https://svnweb.freebsd.org/changeset/base/368494 Log: MFC of 368396 and 368425. Document BA_CLRBUF flag. Sponsored by: Netflix Modified: stable/12/sys/fs/ext2fs/ext2_extern.h stable/12/sys/ufs/ufs/ufs_extern.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/fs/ext2fs/ext2_extern.h ============================================================================== --- stable/12/sys/fs/ext2fs/ext2_extern.h Wed Dec 9 20:38:26 2020 (r368493) +++ stable/12/sys/fs/ext2fs/ext2_extern.h Wed Dec 9 22:37:23 2020 (r368494) @@ -135,6 +135,13 @@ void ext2_gd_csum_set(struct m_ext2fs *); /* Flags to low-level allocation routines. * The low 16-bits are reserved for IO_ flags from vnode.h. + * + * The BA_CLRBUF flag specifies that the existing content of the block + * will not be completely overwritten by the caller, so buffers for new + * blocks must be cleared and buffers for existing blocks must be read. + * When BA_CLRBUF is not set the buffer will be completely overwritten + * and there is no reason to clear them or to spend I/O fetching existing + * data. The BA_CLRBUF flag is handled in the ext2_balloc() functions. */ #define BA_CLRBUF 0x00010000 /* Clear invalid areas of buffer. */ #define BA_SEQMASK 0x7F000000 /* Bits holding seq heuristic. */ Modified: stable/12/sys/ufs/ufs/ufs_extern.h ============================================================================== --- stable/12/sys/ufs/ufs/ufs_extern.h Wed Dec 9 20:38:26 2020 (r368493) +++ stable/12/sys/ufs/ufs/ufs_extern.h Wed Dec 9 22:37:23 2020 (r368494) @@ -119,6 +119,13 @@ void softdep_revert_rmdir(struct inode *, struct inode * * Note: The general vfs code typically limits the sequential heuristic * count to 127. See sequential_heuristic() in kern/vfs_vnops.c + * + * The BA_CLRBUF flag specifies that the existing content of the block + * will not be completely overwritten by the caller, so buffers for new + * blocks must be cleared and buffers for existing blocks must be read. + * When BA_CLRBUF is not set the buffer will be completely overwritten + * and there is no reason to clear them or to spend I/O fetching existing + * data. The BA_CLRBUF flag is handled in the UFS_BALLOC() functions. */ #define BA_CLRBUF 0x00010000 /* Clear invalid areas of buffer. */ #define BA_METAONLY 0x00020000 /* Return indirect block buffer. */