OSDN Git Service

dasd: cache real_sector_size in linux_probe
authorHans de Goede <hdegoede@redhat.com>
Tue, 3 Nov 2009 12:08:58 +0000 (13:08 +0100)
committerJim Meyering <meyering@redhat.com>
Wed, 4 Nov 2009 11:32:30 +0000 (12:32 +0100)
commit0d5c7bc90cb41ae7798a83b3efe4119ca4886f61
tree65350a5093587bc59911877312948948116afeaf
parenta665b2f0f6f7879ff91967765c08a44979e4a230
dasd: cache real_sector_size in linux_probe

dasd_alloc was doing an ioctl to get the real sector size for the dasd
device (we are faking 512 bytes sectors), but when called directly
from ped_disk_new_fresh(), the device is not open causing this to fail.

This patch fixes things by caching the real_sector_size in the linux
arch_specific data and making the dasd label handling use this.
libparted/arch/linux.c(_device_set_sector_size): Cache real sector size.
(_device_set_sector_size, init_dasd, linux_new): Only compile dasd code
on s390 and s390x.
libparted/arch/linux.c
libparted/labels/dasd.c