[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Libguestfs] FYI: nbdfuse support for trim and writing zeroes

I added support for trimming to nbdfuse over the weekend:


This intercepts Linux fallocate(2) on the file and if the mode
parameter contains FALLOC_FL_PUNCH_HOLE then it will punch a hole
using nbd_trim.  This all appears to work fine.

As noted in the above commit, in theory we could also check for
mode & FALLOC_FL_ZERO_RANGE.  When I use "fallocate -z ..." on a file,
I see this is the mode parameter being passed to the system call:

  fallocate(3, FALLOC_FL_ZERO_RANGE, 512, 512) = 0

However it appears as if the fuse kernel module doesn't pass the flag
through to nbdfuse.  (I checked the kernel code too, and that *seems*
to agree with my assessment).  So for now I left support for zeroing
in there but disabled the test.

The fuse developer mailing list seems to be mostly spam.  There is
this closed github issue which says to contact the kernel developers
which I have not done:


Next step for nbdfuse is to add multithreading support which would
greatly improve performance but is rather complicated to implement.


Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-top is 'top' for virtual machines.  Tiny program with many
powerful monitoring features, net stats, disk stats, logging, etc.

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]