From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Thu, 27 Oct 2005 16:49:59 -0700 From: Andrew Morton Subject: Re: [RFC] madvise(MADV_TRUNCATE) Message-Id: <20051027164959.61d04327.akpm@osdl.org> In-Reply-To: <17249.25225.582755.489919@wombat.chubb.wattle.id.au> References: <1130366995.23729.38.camel@localhost.localdomain> <200510271038.52277.ak@suse.de> <20051027131725.GI5091@opteron.random> <1130425212.23729.55.camel@localhost.localdomain> <20051027151123.GO5091@opteron.random> <20051027112054.10e945ae.akpm@osdl.org> <20051027200434.GT5091@opteron.random> <17249.25225.582755.489919@wombat.chubb.wattle.id.au> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org Return-Path: To: Peter Chubb Cc: andrea@suse.de, pbadari@us.ibm.com, ak@suse.de, hugh@veritas.com, jdike@addtoit.com, dvhltc@us.ibm.com, linux-mm@kvack.org List-ID: Peter Chubb wrote: > > >>>>> "Andrea" == Andrea Arcangeli writes: > > Andrea> On Thu, Oct 27, 2005 at 11:20:54AM -0700, Andrew Morton wrote: > > Andrea> The idea is to implement a sys_truncate_range, but using the > Andrea> mappings so the user doesn't need to keep track of which parts > Andrea> of the file have to be truncated, and it only needs to know > Andrea> which part of the address space is obsolete. This will be the > Andrea> first API that allows to re-create holes in files. > > The preexisting art is for the SysVr4 fcntl(fd, F_FREESP, &lk); > which frees space in the file covered by the struct flock * third > argument. Thanks. That's a rather klunky API but it'd be straightforward enough to implement. However if we did this we'd need to do a 64-bit version as well, using flock64. Which means we really needn't bother with the 32-bit version, which means we're not svr4-compatible, unless svr4 also has a 64-bit version?? > Depending on the fileystem, this may or may not work in > the middle of a file: it does for XFS, and could for tmpfs. It always > works at the end of a file. So that should be `first API in Linux' Sounds sane. -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org