From owner-svn-src-all@freebsd.org Sun Dec 6 20:50:22 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 B3A724AA5A2; Sun, 6 Dec 2020 20:50:22 +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 4Cpz9B4WnDz4p2m; Sun, 6 Dec 2020 20:50:22 +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 89444162D0; Sun, 6 Dec 2020 20:50:22 +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 0B6KoMDn057355; Sun, 6 Dec 2020 20:50:22 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0B6KoMcE057354; Sun, 6 Dec 2020 20:50:22 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <202012062050.0B6KoMcE057354@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Sun, 6 Dec 2020 20:50:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r368396 - in head/sys: fs/ext2fs ufs/ufs X-SVN-Group: head X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: in head/sys: fs/ext2fs ufs/ufs X-SVN-Commit-Revision: 368396 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: Sun, 06 Dec 2020 20:50:22 -0000 Author: mckusick Date: Sun Dec 6 20:50:21 2020 New Revision: 368396 URL: https://svnweb.freebsd.org/changeset/base/368396 Log: Document the BA_CLRBUF flag used in ufs and ext2fs filesystems. Suggested by: kib MFC after: 3 days Sponsored by: Netflix Modified: head/sys/fs/ext2fs/ext2_extern.h head/sys/ufs/ufs/ufs_extern.h Modified: head/sys/fs/ext2fs/ext2_extern.h ============================================================================== --- head/sys/fs/ext2fs/ext2_extern.h Sun Dec 6 19:24:38 2020 (r368395) +++ head/sys/fs/ext2fs/ext2_extern.h Sun Dec 6 20:50:21 2020 (r368396) @@ -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 UFS_BALLOC() functions. */ #define BA_CLRBUF 0x00010000 /* Clear invalid areas of buffer. */ #define BA_SEQMASK 0x7F000000 /* Bits holding seq heuristic. */ Modified: head/sys/ufs/ufs/ufs_extern.h ============================================================================== --- head/sys/ufs/ufs/ufs_extern.h Sun Dec 6 19:24:38 2020 (r368395) +++ head/sys/ufs/ufs/ufs_extern.h Sun Dec 6 20:50:21 2020 (r368396) @@ -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. */