Dismiss
InnovationQ will be updated on Sunday, Oct. 22, from 10am ET - noon. You may experience brief service interruptions during that time.
Browse Prior Art Database

Method of Handling "Ftrunc" System Call for Mapped Files

IP.com Disclosure Number: IPCOM000062317D
Original Publication Date: 1986-Nov-01
Included in the Prior Art Database: 2005-Mar-09
Document File: 1 page(s) / 12K

Publishing Venue

IBM

Related People

Duvall, KE: AUTHOR [+2]

Abstract

By providing special handling of the "ftrunc" system call in a mapped file environment, efficient handling and relatively transparent implementation of the call are provided. Special handling is required for the UNIX* "ftrunc" system call when a file is currently mapped (Virtual Memory Manager (VMM) mapping of a virtual memory segment to disk blocks of a file which allows Virtual Resource Manager (VRM) to perform required disk I/O). The ftrunc system call is supposed to remove all data beyond a specified length. One restriction which is required when the ftrunc system call is used with a mapped file, is that no Copy-on-Write segments exist for the file, since truncation may cause the undesired release of modified Copy-on-Write pages. If Copy-on-Write segments exist, an error message is returned if ftrunc is invoked.

This text was extracted from a PDF file.
This is the abbreviated version, containing approximately 70% of the total text.

Page 1 of 1

Method of Handling "Ftrunc" System Call for Mapped Files

By providing special handling of the "ftrunc" system call in a mapped file environment, efficient handling and relatively transparent implementation of the call are provided. Special handling is required for the UNIX* "ftrunc" system call when a file is currently mapped (Virtual Memory Manager (VMM) mapping of a virtual memory segment to disk blocks of a file which allows Virtual Resource Manager (VRM) to perform required disk I/O). The ftrunc system call is supposed to remove all data beyond a specified length. One restriction which is required when the ftrunc system call is used with a mapped file, is that no Copy- on-Write segments exist for the file, since truncation may cause the undesired release of modified Copy-on-Write pages. If Copy-on-Write segments exist, an error message is returned if ftrunc is invoked. A method of handling the ftrunc system call, when the file corresponding to the file descriptor specified is mapped, is as follows: 1. The segment range is unmapped from the specified length and rounded up to a 2K (page) boundary to the end of the current file size, thereby unmapping, via Unmap VRM Supervisor Call (SVC), all pages corresponding to disk blocks subject to truncation. 2. The truncated disk blocks are released via a call made to the "bitrunc" routine in the file "fsubr.c". 3. A call is made to the "bzero" routine in the file "machdep.c" which zeros out the memory segment from the s...