[parted-devel] [PATCH 06/11] libparted: respect optimal IO alignment
Jim Meyering
jim at meyering.net
Mon Jan 7 16:54:37 UTC 2013
Phillip Susi wrote:
> If the optimal IO size provided by the kernel was less than 1 MiB
> or not an even power of two, parted ignored it and used 1 MiB
> instead. Values less than 1 MiB or not an even power of two are
> common with raid arrays, so respect the kernel supplied value.
> Regular disks will still use 1 MiB since the kernel returns a
> value of zero.
Hi Phillip,
I would like to continue using the existing guards or similar
when operating on regular disks. Can you adjust this change to
remove the guards only when the device is a raid array?
...
> +++ b/libparted/arch/linux.c
> @@ -2977,16 +2977,7 @@ linux_get_optimum_alignment(const PedDevice *dev)
> If one or the other will not divide evenly, fall through to
> previous logic. */
> unsigned long optimal_io = blkid_topology_get_optimal_io_size(tp);
> - unsigned long minimum_io = blkid_topology_get_minimum_io_size(tp);
> - if (
> - (!optimal_io && !minimum_io)
> - || (optimal_io && PED_DEFAULT_ALIGNMENT % optimal_io == 0
> - && minimum_io && PED_DEFAULT_ALIGNMENT % minimum_io == 0)
> - || (!minimum_io && optimal_io
> - && PED_DEFAULT_ALIGNMENT % optimal_io == 0)
> - || (!optimal_io && minimum_io
> - && PED_DEFAULT_ALIGNMENT % minimum_io == 0)
> - ) {
> + if (!optimal_io) {
...
More information about the parted-devel
mailing list