Re: [Nbd] TRIM stuff
- To: Wouter Verhelst <w@...112...>
- Cc: nbd-general@lists.sourceforge.net
- Subject: Re: [Nbd] TRIM stuff
- From: Folkert van Heusden <folkert@...421...>
- Date: Fri, 16 Sep 2011 11:35:04 +0200
- Message-id: <CAFDOyVB5zKcS+nhzKvjZVu02eJmyunm+TFfzgY11sRopWmSbOg@...18...>
- In-reply-to: <20110916092653.GD19601@...3...>
- References: <20110916082609.GA19601@...3...> <09186A6CB15FD629B0643AD6@...873...> <20110916092653.GD19601@...3...>
>> > So yesterday I implemented the fallocate(FALLOC_FL_PUNCH_HOLE) stuff for
>> > NBD_CMD_TRIM. It's compile-tested, but not yet functionally tested. To
>> > be honest, I'm not entirely sure how to test whether a file is sparse in
>> > a particular region; anyone?
>>
>> I think you can use debugfs's dump_extents command (from memory).
>
> Yes, but that requires an unmounted filesystem. If I want to add this to
> the test suite, that's not going to work.
Maybe the FIBMAP/FIEMAP ioctls can help you.
See http://www.mirrorservice.org/sites/dl.sourceforge.net/pub/sourceforge/g/project/gu/gujin/gujin/2.8.1/gujin-2.8.1.tar.gz/gujin/showmap.c?extract=true
for an example.
Reply to: