ahci: add partition check for drives

Signed-off-by: Michael Shaw <m@michaelsshaw.com>
This commit is contained in:
Michael Shaw 2026-07-14 19:44:16 -04:00
commit 228bd9de9c

View file

@ -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;