From: Andreas Dilger Subject: Re: File perforation. Date: Wed, 8 Jan 2003 20:23:07 -0700 Sender: linux-fsdevel-owner@vger.kernel.org Message-ID: <20030108202306.I31555@schatzie.adilger.int> References: <3E1CAC90.6050303@inet.com> <23586.1042067699@passion.cambridge.redhat.com> <3E1CCEF3.3409DCED@digeo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: David Woodhouse , Eli Carter , linux-fsdevel@vger.kernel.org Return-path: To: Andrew Morton Content-Disposition: inline In-Reply-To: <3E1CCEF3.3409DCED@digeo.com>; from akpm@digeo.com on Wed, Jan 08, 2003 at 05:22:59PM -0800 List-Id: linux-fsdevel.vger.kernel.org On Jan 08, 2003 17:22 -0800, Andrew Morton wrote: > A full holepunch()/perforate() thing is, as Dave points out, a trickier > version of truncate. It's quite a hassle for not a lot of gain on > the block filesystems. Peter actually had a working version of this, what we called "punch", for ext2 and I did the ext3 port in the 2.2 and early 2.3 days. The original motivator was HSM, because some applications (Windows mainly) checked both the beginning and end of a file for data (icons I think) when you opened a folder (unlike "file" magic which is just the first 64kB at most), so it was critical for the HSM system to be able to do hole punching in the middle of the file. Similarly, InterMezzo would like to be able to do partial cacheing of giant files by essentially having a block LRU of a file and punching out the unused blocks of a file without disturbing the other content. InterMezzo also has a use for this to have an always-growing modification log, and the server can punch out the blocks of data at the beginning of the log when all clients have pulled those updates and/or those updates have been superceded by later changes. I think there is pent up demand for this, and applications would take advantage of this if it where available. A simple syscall like sys_punch(file, start, end) (or start, count) is the natural thing to have. If end > file_size it becomes equal to truncate. Cheers, Andreas -- Andreas Dilger http://sourceforge.net/projects/ext2resize/ http://www-mddsp.enel.ucalgary.ca/People/adilger/