From owner-freebsd-fs@FreeBSD.ORG Fri Dec 10 00:57:20 2010 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 92BB6106566C; Fri, 10 Dec 2010 00:57:20 +0000 (UTC) (envelope-from mckusick@mckusick.com) Received: from chez.mckusick.com (chez.mckusick.com [64.81.247.49]) by mx1.freebsd.org (Postfix) with ESMTP id 372528FC13; Fri, 10 Dec 2010 00:57:20 +0000 (UTC) Received: from chez.mckusick.com (localhost [127.0.0.1]) by chez.mckusick.com (8.14.3/8.14.3) with ESMTP id oBA0vIgT065481; Thu, 9 Dec 2010 16:57:18 -0800 (PST) (envelope-from mckusick@chez.mckusick.com) Message-Id: <201012100057.oBA0vIgT065481@chez.mckusick.com> To: Bakul Shah In-reply-to: <20101210003749.3F7E15B92@mail.bitblocks.com> Date: Thu, 09 Dec 2010 16:57:18 -0800 From: Kirk McKusick Cc: freebsd-fs@freebsd.org, pjd@freebsd.org, Oliver Fromme Subject: Re: TRIM support for UFS? X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Dec 2010 00:57:20 -0000 > To: Kirk McKusick > cc: Kostik Belousov , freebsd-fs@freebsd.org, > pjd@freebsd.org, Oliver Fromme > Subject: Re: TRIM support for UFS? > Date: Thu, 09 Dec 2010 16:37:48 -0800 > From: Bakul Shah > X-ASK-Info: Message Queued (2010/12/09 16:37:54) > X-ASK-Info: Confirmed by User (2010/12/09 16:39:17) > > Would be nice if something like ftrim(fd, offset, size) or > trim(path, offsetm size) or TRIM file ioctl is added, to free > up blocks undelying a given range in a file. ftruncate can > delete blocks at the end but there is no facility to lose > blocks in the middle. Mainly handy for virtual disks and > databases (and would work nicely with SEEK_DATA, SEEK_HOLE). We have discussed adding such a system call over the years (actually we called it `release' rather than `trim'). If such a call ever does get added, any blocks that it actually manages to release will get passed through to BIO_DELETE by the changes that Kostik is soon to add to the system. Kirk McKusick