OSDN Git Service

linux: use libblkid to determine ->phys_sector_size
authorJim Meyering <meyering@redhat.com>
Thu, 15 Oct 2009 19:29:36 +0000 (21:29 +0200)
committerJim Meyering <meyering@redhat.com>
Mon, 19 Oct 2009 12:58:26 +0000 (14:58 +0200)
commit979bf88defcd1411c4c0adf5faa3d4b0e27b4ac4
tree2a5182db1c12b88542c6380f11439d1e4c6b5894
parentf6859f2fcbcf18a069a0495cbb8bd2baf395e74d
linux: use libblkid to determine ->phys_sector_size

Before this change, creating a memory-mapped disk on a fedora-based
system running 2.6.31.1-56.fc12.x86_64 using this command:
modprobe scsi_debug dev_size_mb=1025 sector_size=4096
and then running "parted -s /dev/sdd mklabel gpt print"
would mistakenly print "Sector size (logical/physical): 4096B/512B"
The "512B" is what's wrong.  It should be "4096B".
* configure.ac: Test for a new-enough blkid library.
* libparted/Makefile.am (libparted_la_LIBADD): Add $(LIB_BLKID).
* libparted/arch/linux.c (get_minimum_io_size): New function.
(_device_set_sector_size): Use it.
configure.ac
libparted/Makefile.am
libparted/arch/linux.c