From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matthew Wilcox Subject: Re: [PATCH 10/7] [BLOCK] Add BLKDISCARD ioctl to allow userspace to discard sectors Date: Mon, 11 Aug 2008 12:27:09 -0600 Message-ID: <20080811182709.GT8618@parisc-linux.org> References: <1218299181.26926.88.camel@pmac.infradead.org> <1218467472.2977.9.camel@pmac.infradead.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Jens Axboe , Andrew Morton , Ric Wheeler , linux-fsdevel@vger.kernel.org, gilad@codefidence.com To: David Woodhouse Return-path: Received: from palinux.external.hp.com ([192.25.206.14]:33962 "EHLO mail.parisc-linux.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752681AbYHKS10 (ORCPT ); Mon, 11 Aug 2008 14:27:26 -0400 Content-Disposition: inline In-Reply-To: <1218467472.2977.9.camel@pmac.infradead.org> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Mon, Aug 11, 2008 at 04:11:12PM +0100, David Woodhouse wrote: > We may well want mkfs tools to use this to mark the whole device as > unwanted before they format it, for example. > > The ioctl takes a pair of uint64_ts, which are start offset and length > in _bytes_. Although at the moment it might make sense for them both to > be in 512-byte sectors, I don't want to limit the ABI to that. http://techpubs.sgi.com/library/tpl/cgi-bin/getdoc.cgi?coll=0650&db=man&fname=/usr/share/catman/p_man/cat2/standard/fcntl.z Their F_FREESP does pretty much exactly this. I also like the idea of extending MADV_REMOVE to work on devices which support PUNCH/TRIM/DISCARD, and adding a LINUX_FADV_REMOVE to fadvise. -- Intel are signing my paycheques ... these opinions are still mine "Bill, look, we understand that you're interested in selling us this operating system, but compare it to ours. We can't possibly take such a retrograde step."