A limitation of the fstrim patch is that it didn't work for
partitions.  This is because of the convoluted way that we were
searching for the /sys/block device using directory searching.

A simpler way to do it is to go via /sys/dev/block/MAJOR:MINOR and
this also lets us easily map from partitions to devices, to find the
discard parameters of the parent device.

This commit removes all the complex directory searching, and just uses
simple file opens.

It also ensures that the partition is aligned to the discard block
size.  In older Windows (before ~2008) partitions were aligned to 512
bytes.  The discard block size is usually 4K or larger.  Therefore
it's (nearly) impossible to discard correctly on these partitions.
This patch rejects these cases.

Rich.


------------------------------------------------------------------------------
Infragistics Professional
Build stunning WinForms apps today!
Reboot your WinForms applications with our WinForms controls. 
Build a bridge from your legacy apps to the future.
http://pubads.g.doubleclick.net/gampad/clk?id=153845071&iu=/4140/ostg.clktrk
_______________________________________________
ntfs-3g-devel mailing list
ntfs-3g-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ntfs-3g-devel

Reply via email to