unsigned char *res = kmalloc(66, GFP_KERNEL);
if (res) {
struct block_device *bdev = dev->bd_contains;
- struct buffer_head *bh = __bread(bdev, 0, block_size(bdev));
- if (bh) {
- memcpy(res, bh->b_data + 0x1be, 66);
- brelse(bh);
+ Sector sect;
+ void *data = read_dev_sector(bdev, 0, §);
+ if (data) {
+ memcpy(res, data + 0x1be, 66);
+ put_dev_sector(sect);
} else {
kfree(res);
res = NULL;
}
return res;
}
+EXPORT_SYMBOL(scsi_bios_ptable);
/*
* Function : int scsicam_bios_param (struct block_device *bdev, ector_t capacity, int *ip)
int scsicam_bios_param(struct block_device *bdev, sector_t capacity, int *ip)
{
unsigned char *p;
+ u64 capacity64 = capacity; /* Suppress gcc warning */
int ret;
p = scsi_bios_ptable(bdev);
(unsigned int *)ip + 0, (unsigned int *)ip + 1);
kfree(p);
- if (ret == -1) {
+ if (ret == -1 && capacity64 < (1ULL << 32)) {
/* pick some standard mapping with at most 1024 cylinders,
and at most 62 sectors per track - this works up to
7905 MB */
return 0;
}
+EXPORT_SYMBOL(scsicam_bios_param);
/*
* Function : static int scsi_partsize(unsigned char *buf, unsigned long
}
return -1;
}
+EXPORT_SYMBOL(scsi_partsize);
/*
* Function : static int setsize(unsigned long capacity,unsigned int *cyls,