Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F156497859
D29637.id87065.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D29637.id87065.diff
View Options
Index: share/man/man9/vnode_pager_setsize.9
===================================================================
--- share/man/man9/vnode_pager_setsize.9
+++ share/man/man9/vnode_pager_setsize.9
@@ -27,7 +27,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.Dd April 6, 2021
+.Dd April 8, 2021
.Dt VNODE_PAGER_SETSIZE 9
.Os
.Sh NAME
@@ -41,26 +41,30 @@
.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
+lets the VM system know about a change in size for a file,
+and updates the object size of the vm object in
+.Fa vp
+with
.Fa nsize
-argument will be purged from the cache.
+rounded up to next page boundary.
+.Pp
+Pages between the old EOF and the new EOF are removed from the object queue
+if the file size shrinks.
+In case the new EOF is not aligned to page boundary,
+if the page which the new EOF is on exists resident,
+partial-page area starting from the new EOF will be zeroed.
+On that page, for content occupying whole blocks within block
+boundaries, dirty bits for the corresponding blocks will be cleared.
+.Pp
+In case the vnode
+.Fa vp
+does not have a VM object, the effect of calling this function is no-op.
+.Pp
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 LOCKS
+The vnode should be exclusively locked on entry and will still be locked on exit.
.Sh SEE ALSO
.Xr vnode 9
.Sh HISTORY
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, May 15, 3:39 AM (6 h, 47 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
33071952
Default Alt Text
D29637.id87065.diff (1 KB)
Attached To
Mode
D29637: vnode_pager_setsize.9: Some clarifications on the manpage
Attached
Detach File
Event Timeline
Log In to Comment