summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorBrian C. Lane <bcl@redhat.com>2010-12-10 11:26:53 -0800
committerJim Meyering <meyering@redhat.com>2010-12-15 11:08:46 +0100
commitc749046a54d983f74f8156c0aea71b0995b9477d (patch)
treefb1b68ab9367d17733bc10cde4822e372b28db9f /include
parenta7c7a29fc4df09e546357793fe79b46b08061ed4 (diff)
downloadparted-c749046a54d983f74f8156c0aea71b0995b9477d.tar.gz
default to 1MiB alignment when possible
Change the linux_get_optimum_alignment() function to prefer aligning partitions to PED_DEFAULT_ALIGNMENT (1MiB), if possible. This helps tools like anaconda better support 4k sector drives. * include/parted/parted.h (PED_DEFAULT_ALIGNMENT): Define. * libparted/arch/linux.c (linux_get_optimum_alignment): Adjust. See comments for details. * libparted/device.c (ped_device_get_optimum_alignment): Use PED_DEFAULT_ALIGNMENT rather than hard-coded 1048576. * tests/t9020-alignment.sh: Adjust expectations to match new behavior. See http://bugzilla.redhat.com/618255 for details.
Diffstat (limited to 'include')
-rw-r--r--include/parted/parted.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/parted/parted.h b/include/parted/parted.h
index b2bd2e0..a56d6a5 100644
--- a/include/parted/parted.h
+++ b/include/parted/parted.h
@@ -20,6 +20,8 @@
#ifndef PARTED_H_INCLUDED
#define PARTED_H_INCLUDED
+#define PED_DEFAULT_ALIGNMENT (1024 * 1024)
+
#ifdef __cplusplus
extern "C" {
#endif