diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-01-31 20:04:22 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-01-31 20:04:22 -0500 |
commit | cc6c954a076c5df7e0ac8d5e4ffa8b4f5572ae1d (patch) | |
tree | 5a53c5b15edf849a9ea390ca90342d0ffac99fdc | |
parent | cf5425bfcd6909f9831a00bc06ccb9a5b163766a (diff) | |
parent | fe7af2d3babefabd96a39e8b0d58ede88f3c7993 (diff) |
Merge tag 'dm-3.8-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/agk/linux-dm
Pull more device-mapper fixes from Alasdair G Kergon:
"A fix for stacked dm thin devices and a fix for the new dm WRITE SAME
support."
* tag 'dm-3.8-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/agk/linux-dm:
dm: fix write same requests counting
dm thin: fix queue limits stacking
-rw-r--r-- | drivers/md/dm-thin.c | 13 | ||||
-rw-r--r-- | drivers/md/dm.c | 6 |
2 files changed, 5 insertions, 14 deletions
diff --git a/drivers/md/dm-thin.c b/drivers/md/dm-thin.c index 675ae5274016..5409607d4875 100644 --- a/drivers/md/dm-thin.c +++ b/drivers/md/dm-thin.c | |||
@@ -2746,19 +2746,9 @@ static int thin_iterate_devices(struct dm_target *ti, | |||
2746 | return 0; | 2746 | return 0; |
2747 | } | 2747 | } |
2748 | 2748 | ||
2749 | /* | ||
2750 | * A thin device always inherits its queue limits from its pool. | ||
2751 | */ | ||
2752 | static void thin_io_hints(struct dm_target *ti, struct queue_limits *limits) | ||
2753 | { | ||
2754 | struct thin_c *tc = ti->private; | ||
2755 | |||
2756 | *limits = bdev_get_queue(tc->pool_dev->bdev)->limits; | ||
2757 | } | ||
2758 | |||
2759 | static struct target_type thin_target = { | 2749 | static struct target_type thin_target = { |
2760 | .name = "thin", | 2750 | .name = "thin", |
2761 | .version = {1, 6, 0}, | 2751 | .version = {1, 7, 0}, |
2762 | .module = THIS_MODULE, | 2752 | .module = THIS_MODULE, |
2763 | .ctr = thin_ctr, | 2753 | .ctr = thin_ctr, |
2764 | .dtr = thin_dtr, | 2754 | .dtr = thin_dtr, |
@@ -2767,7 +2757,6 @@ static struct target_type thin_target = { | |||
2767 | .postsuspend = thin_postsuspend, | 2757 | .postsuspend = thin_postsuspend, |
2768 | .status = thin_status, | 2758 | .status = thin_status, |
2769 | .iterate_devices = thin_iterate_devices, | 2759 | .iterate_devices = thin_iterate_devices, |
2770 | .io_hints = thin_io_hints, | ||
2771 | }; | 2760 | }; |
2772 | 2761 | ||
2773 | /*----------------------------------------------------------------*/ | 2762 | /*----------------------------------------------------------------*/ |
diff --git a/drivers/md/dm.c b/drivers/md/dm.c index c72e4d5a9617..314a0e2faf79 100644 --- a/drivers/md/dm.c +++ b/drivers/md/dm.c | |||
@@ -1188,6 +1188,7 @@ static int __clone_and_map_changing_extent_only(struct clone_info *ci, | |||
1188 | { | 1188 | { |
1189 | struct dm_target *ti; | 1189 | struct dm_target *ti; |
1190 | sector_t len; | 1190 | sector_t len; |
1191 | unsigned num_requests; | ||
1191 | 1192 | ||
1192 | do { | 1193 | do { |
1193 | ti = dm_table_find_target(ci->map, ci->sector); | 1194 | ti = dm_table_find_target(ci->map, ci->sector); |
@@ -1200,7 +1201,8 @@ static int __clone_and_map_changing_extent_only(struct clone_info *ci, | |||
1200 | * reconfiguration might also have changed that since the | 1201 | * reconfiguration might also have changed that since the |
1201 | * check was performed. | 1202 | * check was performed. |
1202 | */ | 1203 | */ |
1203 | if (!get_num_requests || !get_num_requests(ti)) | 1204 | num_requests = get_num_requests ? get_num_requests(ti) : 0; |
1205 | if (!num_requests) | ||
1204 | return -EOPNOTSUPP; | 1206 | return -EOPNOTSUPP; |
1205 | 1207 | ||
1206 | if (is_split_required && !is_split_required(ti)) | 1208 | if (is_split_required && !is_split_required(ti)) |
@@ -1208,7 +1210,7 @@ static int __clone_and_map_changing_extent_only(struct clone_info *ci, | |||
1208 | else | 1210 | else |
1209 | len = min(ci->sector_count, max_io_len(ci->sector, ti)); | 1211 | len = min(ci->sector_count, max_io_len(ci->sector, ti)); |
1210 | 1212 | ||
1211 | __issue_target_requests(ci, ti, ti->num_discard_requests, len); | 1213 | __issue_target_requests(ci, ti, num_requests, len); |
1212 | 1214 | ||
1213 | ci->sector += len; | 1215 | ci->sector += len; |
1214 | } while (ci->sector_count -= len); | 1216 | } while (ci->sector_count -= len); |