block: Do away with the notion of hardsect_size
Until now we have had a 1:1 mapping between storage device physical block size and the logical block sized used when addressing the device. With SATA 4KB drives coming out that will no longer be the case. The sector size will be 4KB but the logical block size will remain 512-bytes. Hence we need to distinguish between the physical block size and the logical ditto. This patch renames hardsect_size to logical_block_size. Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
This commit is contained in:
committed by
Jens Axboe
parent
9bd7de51ee
commit
e1defc4ff0
@@ -108,7 +108,8 @@ static void combine_restrictions_low(struct io_restrictions *lhs,
|
||||
lhs->max_hw_segments =
|
||||
min_not_zero(lhs->max_hw_segments, rhs->max_hw_segments);
|
||||
|
||||
lhs->hardsect_size = max(lhs->hardsect_size, rhs->hardsect_size);
|
||||
lhs->logical_block_size = max(lhs->logical_block_size,
|
||||
rhs->logical_block_size);
|
||||
|
||||
lhs->max_segment_size =
|
||||
min_not_zero(lhs->max_segment_size, rhs->max_segment_size);
|
||||
@@ -529,7 +530,8 @@ void dm_set_device_limits(struct dm_target *ti, struct block_device *bdev)
|
||||
rs->max_hw_segments =
|
||||
min_not_zero(rs->max_hw_segments, q->max_hw_segments);
|
||||
|
||||
rs->hardsect_size = max(rs->hardsect_size, q->hardsect_size);
|
||||
rs->logical_block_size = max(rs->logical_block_size,
|
||||
queue_logical_block_size(q));
|
||||
|
||||
rs->max_segment_size =
|
||||
min_not_zero(rs->max_segment_size, q->max_segment_size);
|
||||
@@ -683,8 +685,8 @@ static void check_for_valid_limits(struct io_restrictions *rs)
|
||||
rs->max_phys_segments = MAX_PHYS_SEGMENTS;
|
||||
if (!rs->max_hw_segments)
|
||||
rs->max_hw_segments = MAX_HW_SEGMENTS;
|
||||
if (!rs->hardsect_size)
|
||||
rs->hardsect_size = 1 << SECTOR_SHIFT;
|
||||
if (!rs->logical_block_size)
|
||||
rs->logical_block_size = 1 << SECTOR_SHIFT;
|
||||
if (!rs->max_segment_size)
|
||||
rs->max_segment_size = MAX_SEGMENT_SIZE;
|
||||
if (!rs->seg_boundary_mask)
|
||||
@@ -914,7 +916,7 @@ void dm_table_set_restrictions(struct dm_table *t, struct request_queue *q)
|
||||
blk_queue_max_sectors(q, t->limits.max_sectors);
|
||||
q->max_phys_segments = t->limits.max_phys_segments;
|
||||
q->max_hw_segments = t->limits.max_hw_segments;
|
||||
q->hardsect_size = t->limits.hardsect_size;
|
||||
q->logical_block_size = t->limits.logical_block_size;
|
||||
q->max_segment_size = t->limits.max_segment_size;
|
||||
q->max_hw_sectors = t->limits.max_hw_sectors;
|
||||
q->seg_boundary_mask = t->limits.seg_boundary_mask;
|
||||
|
Reference in New Issue
Block a user