aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/md/dm-table.c9
-rw-r--r--include/linux/device-mapper.h1
2 files changed, 10 insertions, 0 deletions
diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c
index 907b08ddb783..9558a4acec12 100644
--- a/drivers/md/dm-table.c
+++ b/drivers/md/dm-table.c
@@ -97,6 +97,8 @@ static void combine_restrictions_low(struct io_restrictions *lhs,
97 97
98 lhs->seg_boundary_mask = 98 lhs->seg_boundary_mask =
99 min_not_zero(lhs->seg_boundary_mask, rhs->seg_boundary_mask); 99 min_not_zero(lhs->seg_boundary_mask, rhs->seg_boundary_mask);
100
101 lhs->no_cluster |= rhs->no_cluster;
100} 102}
101 103
102/* 104/*
@@ -523,6 +525,8 @@ int dm_get_device(struct dm_target *ti, const char *path, sector_t start,
523 rs->seg_boundary_mask = 525 rs->seg_boundary_mask =
524 min_not_zero(rs->seg_boundary_mask, 526 min_not_zero(rs->seg_boundary_mask,
525 q->seg_boundary_mask); 527 q->seg_boundary_mask);
528
529 rs->no_cluster |= !test_bit(QUEUE_FLAG_CLUSTER, &q->queue_flags);
526 } 530 }
527 531
528 return r; 532 return r;
@@ -832,6 +836,11 @@ void dm_table_set_restrictions(struct dm_table *t, struct request_queue *q)
832 q->hardsect_size = t->limits.hardsect_size; 836 q->hardsect_size = t->limits.hardsect_size;
833 q->max_segment_size = t->limits.max_segment_size; 837 q->max_segment_size = t->limits.max_segment_size;
834 q->seg_boundary_mask = t->limits.seg_boundary_mask; 838 q->seg_boundary_mask = t->limits.seg_boundary_mask;
839 if (t->limits.no_cluster)
840 q->queue_flags &= ~(1 << QUEUE_FLAG_CLUSTER);
841 else
842 q->queue_flags |= (1 << QUEUE_FLAG_CLUSTER);
843
835} 844}
836 845
837unsigned int dm_table_get_num_targets(struct dm_table *t) 846unsigned int dm_table_get_num_targets(struct dm_table *t)
diff --git a/include/linux/device-mapper.h b/include/linux/device-mapper.h
index 51e0e95a421a..aee10b2ea4c6 100644
--- a/include/linux/device-mapper.h
+++ b/include/linux/device-mapper.h
@@ -97,6 +97,7 @@ struct io_restrictions {
97 unsigned short hardsect_size; 97 unsigned short hardsect_size;
98 unsigned int max_segment_size; 98 unsigned int max_segment_size;
99 unsigned long seg_boundary_mask; 99 unsigned long seg_boundary_mask;
100 unsigned char no_cluster; /* inverted so that 0 is default */
100}; 101};
101 102
102struct dm_target { 103struct dm_target {