Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=91212507f93778c09d4c1335207b6f4b995f5ad1
Commit:     91212507f93778c09d4c1335207b6f4b995f5ad1
Parent:     69267a30bed1fabec658058c63845528a8b813d4
Author:     Neil Brown <[EMAIL PROTECTED]>
AuthorDate: Thu Dec 13 14:16:04 2007 +0000
Committer:  Alasdair G Kergon <[EMAIL PROTECTED]>
CommitDate: Thu Dec 20 17:32:12 2007 +0000

    dm: merge max_hw_sector
    
    Make sure dm honours max_hw_sectors of underlying devices
    
      We still have no firm testing evidence in support of this patch but
      believe it may help to resolve some bug reports.  - agk
    
    Signed-off-by: Neil Brown <[EMAIL PROTECTED]>
    Signed-off-by: Alasdair G Kergon <[EMAIL PROTECTED]>
---
 drivers/md/dm-table.c         |    9 +++++++++
 include/linux/device-mapper.h |    1 +
 2 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c
index f3f952e..47818d8 100644
--- a/drivers/md/dm-table.c
+++ b/drivers/md/dm-table.c
@@ -99,6 +99,9 @@ static void combine_restrictions_low(struct io_restrictions 
*lhs,
        lhs->max_segment_size =
                min_not_zero(lhs->max_segment_size, rhs->max_segment_size);
 
+       lhs->max_hw_sectors =
+               min_not_zero(lhs->max_hw_sectors, rhs->max_hw_sectors);
+
        lhs->seg_boundary_mask =
                min_not_zero(lhs->seg_boundary_mask, rhs->seg_boundary_mask);
 
@@ -566,6 +569,9 @@ void dm_set_device_limits(struct dm_target *ti, struct 
block_device *bdev)
        rs->max_segment_size =
                min_not_zero(rs->max_segment_size, q->max_segment_size);
 
+       rs->max_hw_sectors =
+               min_not_zero(rs->max_hw_sectors, q->max_hw_sectors);
+
        rs->seg_boundary_mask =
                min_not_zero(rs->seg_boundary_mask,
                             q->seg_boundary_mask);
@@ -703,6 +709,8 @@ static void check_for_valid_limits(struct io_restrictions 
*rs)
 {
        if (!rs->max_sectors)
                rs->max_sectors = SAFE_MAX_SECTORS;
+       if (!rs->max_hw_sectors)
+               rs->max_hw_sectors = SAFE_MAX_SECTORS;
        if (!rs->max_phys_segments)
                rs->max_phys_segments = MAX_PHYS_SEGMENTS;
        if (!rs->max_hw_segments)
@@ -901,6 +909,7 @@ void dm_table_set_restrictions(struct dm_table *t, struct 
request_queue *q)
        q->max_hw_segments = t->limits.max_hw_segments;
        q->hardsect_size = t->limits.hardsect_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;
        q->bounce_pfn = t->limits.bounce_pfn;
        if (t->limits.no_cluster)
diff --git a/include/linux/device-mapper.h b/include/linux/device-mapper.h
index b8b7c51..e765e19 100644
--- a/include/linux/device-mapper.h
+++ b/include/linux/device-mapper.h
@@ -115,6 +115,7 @@ struct io_restrictions {
        unsigned short          max_hw_segments;
        unsigned short          hardsect_size;
        unsigned int            max_segment_size;
+       unsigned int            max_hw_sectors;
        unsigned long           seg_boundary_mask;
        unsigned long           bounce_pfn;
        unsigned char           no_cluster; /* inverted so that 0 is default */
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to