From owner-dev-commits-src-branches@freebsd.org Fri Sep 3 18:46:59 2021 Return-Path: Delivered-To: dev-commits-src-branches@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 4FC7367A8F2; Fri, 3 Sep 2021 18:46:59 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H1Rbk3kn6z4hhG; Fri, 3 Sep 2021 18:46:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5BB6B146E; Fri, 3 Sep 2021 18:46:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 183IkwhU023650; Fri, 3 Sep 2021 18:46:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 183IkwKL023649; Fri, 3 Sep 2021 18:46:58 GMT (envelope-from git) Date: Fri, 3 Sep 2021 18:46:58 GMT Message-Id: <202109031846.183IkwKL023649@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ka Ho Ng Subject: git: 83d2fee4193a - stable/12 - Document vnode_pager_setsize(9) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: khng X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 83d2fee4193aaeb934d35e24d3f25f5ef77ab40e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Sep 2021 18:46:59 -0000 The branch stable/12 has been updated by khng: URL: https://cgit.FreeBSD.org/src/commit/?id=83d2fee4193aaeb934d35e24d3f25f5ef77ab40e commit 83d2fee4193aaeb934d35e24d3f25f5ef77ab40e Author: Ka Ho Ng AuthorDate: 2021-04-07 11:00:31 +0000 Commit: Ka Ho Ng CommitDate: 2021-09-03 18:46:40 +0000 Document vnode_pager_setsize(9) Sponsored by: The FreeBSD Foundation Reviewed by: bcr Approved by: philip (mentor) Differential Revision: https://reviews.freebsd.org/D29408 (cherry picked from commit 86a52e262a6faf75ee34eaa801f6d8ddaad20733) --- share/man/man9/Makefile | 1 + share/man/man9/vnode_pager_setsize.9 | 74 ++++++++++++++++++++++++++++++++++++ 2 files changed, 75 insertions(+) diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile index ef9c1cc9c674..60ee6ea5aa1a 100644 --- a/share/man/man9/Makefile +++ b/share/man/man9/Makefile @@ -394,6 +394,7 @@ MAN= accept_filter.9 \ vn_isdisk.9 \ vnet.9 \ vnode.9 \ + vnode_pager_setsize.9 \ VOP_ACCESS.9 \ VOP_ACLCHECK.9 \ VOP_ADVISE.9 \ diff --git a/share/man/man9/vnode_pager_setsize.9 b/share/man/man9/vnode_pager_setsize.9 new file mode 100644 index 000000000000..c59a01796f20 --- /dev/null +++ b/share/man/man9/vnode_pager_setsize.9 @@ -0,0 +1,74 @@ +.\" +.\" SPDX-License-Identifier: BSD-2-Clause-FreeBSD +.\" +.\" Copyright (c) 2021 The FreeBSD Foundation +.\" +.\" Portions of this software were developed by Ka Ho Ng +.\" under sponsorship from the FreeBSD Foundation. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.Dd April 6, 2021 +.Dt VNODE_PAGER_SETSIZE 9 +.Os +.Sh NAME +.Nm vnode_pager_setsize +.Nd "notify the VM system about updates in the file size" +.Sh SYNOPSIS +.In sys/param.h +.In vm/vm.h +.In vm/vm_extern.h +.Ft void +.Fn vnode_pager_setsize "struct vnode *vp" "vm_ooffset_t nsize" +.Sh DESCRIPTION +.Nm +lets the VM system know about a change in size for a file. +Content beyond the new EOF specified by the +.Fa nsize +argument will be purged from the cache. +This function is useful for use within file system code to implement +truncation in +.Xr VOP_SETATTR 9 . +.Sh IMPLEMENTATION NOTES +In case the new EOF specified by the +.Fa nsize +argument is not aligned to page boundaries, +partial-page area starting beyond the EOF will be zeroed. +In partial-page area, +for content occupying whole blocks within block +boundaries, +the dirty bits for the corresponding blocks will be cleared. +.Sh LOCKING +Writer lock of the VM object of +.Fa vp +will be held within the function. +.Sh SEE ALSO +.Xr vnode 9 +.Sh HISTORY +The +.Nm +manual page first appeared in +.Fx 14 . +.Sh AUTHORS +This +manual page was written by +.An Ka Ho Ng Aq Mt khng@FreeBSD.org .