Re: [PATCH v3 2/3] block: rust: add `discard_granularity` option to `GenDiskBuilder`

From: Andreas Hindborg

Date: Fri Dec 04 2026 - 09:02:01 EST


"Vitaly Wool" <vitaly.wool@xxxxxxxxxxx> writes:

> From: Igor Belousov <igor.b@xxxxxxxxx>
>
> Allow Rust block drivers to set the discard granularity of their disks.
> It defaults to the physical block size, which is too small for drivers
> that can only deallocate larger units: the block layer splits discards
> larger than the maximum discard size at multiples of the granularity,
> so with a granularity smaller than the driver's unit, a split can fall
> in the middle of a unit that neither part then covers in full.

This change is part of the dependencies for `rufs`[1][2], the Rust UFS
driver [3].

There might be other things you need in that tree.

Best regards,
Andreas Hindborg

[1] https://github.com/SamsungDS/rufs/commit/dbdc0839f0e7eb89a6a203703791a6146827fead
[2] https://github.com/SamsungDS/rufs/commits/rfc/rufs-dependencies
[3] https://lore.kernel.org/r/20260912-rufs-private-v1-1-716db733e655@xxxxxxxxxxx