ahci: add partition check for drives
Signed-off-by: Michael Shaw <m@michaelsshaw.com>
This commit is contained in:
parent
339687cdac
commit
228bd9de9c
1 changed files with 5 additions and 1 deletions
|
|
@ -282,7 +282,7 @@ static ssize_t ahci_block_write(struct block_device *bdev, struct sg_list *sg, s
|
|||
return ahci_rw_sg(bdev->priv, off, n, sg, true);
|
||||
}
|
||||
|
||||
struct sata_device *init_sata_port(struct ahci_host *host, u32 port, int type)
|
||||
static struct sata_device *init_sata_port(struct ahci_host *host, u32 port, int type)
|
||||
{
|
||||
static struct block_ops ahci_block_ops = {
|
||||
.read = ahci_block_read,
|
||||
|
|
@ -357,8 +357,12 @@ struct sata_device *init_sata_port(struct ahci_host *host, u32 port, int type)
|
|||
bdev->size = sdev->sector_count;
|
||||
bdev->block_size = sdev->sector_size;
|
||||
bdev->ops = ahci_block_ops;
|
||||
bdev->disk.is_disk = true;
|
||||
strncpy(bdev->name, name, sizeof(bdev->name) - 1);
|
||||
|
||||
if (!packet)
|
||||
block_check_partitions(bdev);
|
||||
|
||||
devfs_insert_device_blk(bdev->name, bdev, NULL);
|
||||
|
||||
return sdev;
|
||||
|
|
|
|||
Loading…
Reference in a new issue