block: add sg list size limits
Signed-off-by: Michael Shaw <m@michaelsshaw.com>
This commit is contained in:
parent
25c0b538d2
commit
86091c6acb
2 changed files with 7 additions and 0 deletions
|
|
@ -358,8 +358,12 @@ static struct sata_device *init_sata_port(struct ahci_host *host, u32 port, int
|
||||||
bdev->block_size = sdev->sector_size;
|
bdev->block_size = sdev->sector_size;
|
||||||
bdev->ops = ahci_block_ops;
|
bdev->ops = ahci_block_ops;
|
||||||
bdev->disk.is_disk = true;
|
bdev->disk.is_disk = true;
|
||||||
|
|
||||||
strncpy(bdev->name, name, sizeof(bdev->name) - 1);
|
strncpy(bdev->name, name, sizeof(bdev->name) - 1);
|
||||||
|
|
||||||
|
bdev->sg_max_len = 4 * MB;
|
||||||
|
bdev->sg_max_segments = 8;
|
||||||
|
|
||||||
if (!packet)
|
if (!packet)
|
||||||
block_check_partitions(bdev);
|
block_check_partitions(bdev);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,9 @@ struct block_device {
|
||||||
struct block_device *part_of; /* if it is a partition */
|
struct block_device *part_of; /* if it is a partition */
|
||||||
void *priv;
|
void *priv;
|
||||||
|
|
||||||
|
size_t sg_max_len;
|
||||||
|
size_t sg_max_segments;
|
||||||
|
|
||||||
struct block_ops ops;
|
struct block_ops ops;
|
||||||
struct disk disk;
|
struct disk disk;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue