TRIM support for UFS?

Bakul Shah bakul at bitblocks.com
Fri Dec 10 01:35:15 UTC 2010


On Thu, 09 Dec 2010 16:57:18 PST Kirk McKusick <mckusick at mckusick.com>  wrote:
> > To: Kirk McKusick <mckusick at mckusick.com>
> > cc: Kostik Belousov <kostikbel at gmail.com>, freebsd-fs at freebsd.org,
> >         pjd at freebsd.org, Oliver Fromme <olli at lurza.secnetix.de>
> > Subject: Re: TRIM support for UFS? 
> > Date: Thu, 09 Dec 2010 16:37:48 -0800
> > From: Bakul Shah <bakul at bitblocks.com>
> > 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.

That is why this seemed like a good time to mention this!
Probably most of the logic for this can be borrowed from
ftruncate()....

Pawel mentions g_delete() but it seems a bit indirect.


More information about the freebsd-fs mailing list