Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 319468
b: refs/heads/master
c: 7acf027
h: refs/heads/master
v: v3
  • Loading branch information
Mikulas Patocka authored and Alasdair G Kergon committed Jul 27, 2012
1 parent d9cfe67 commit fd974af
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 55f2b8bdb0c7387eb2dc645b9ecbe5d0faa6b54e
refs/heads/master: 7acf0277cea0f2da89ffffcc9892bea23f618e63
5 changes: 4 additions & 1 deletion trunk/drivers/md/dm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1215,7 +1215,10 @@ static int __clone_and_map_discard(struct clone_info *ci)
if (!ti->num_discard_requests)
return -EOPNOTSUPP;

len = min(ci->sector_count, max_io_len_target_boundary(ci->sector, ti));
if (!ti->split_discard_requests)
len = min(ci->sector_count, max_io_len_target_boundary(ci->sector, ti));
else
len = min(ci->sector_count, max_io_len(ci->sector, ti));

__issue_target_requests(ci, ti, ti->num_discard_requests, len);

Expand Down
6 changes: 6 additions & 0 deletions trunk/include/linux/device-mapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,12 @@ struct dm_target {
*/
unsigned discards_supported:1;

/*
* Set if the target required discard request to be split
* on max_io_len boundary.
*/
unsigned split_discard_requests:1;

/*
* Set if this target does not return zeroes on discarded blocks.
*/
Expand Down

0 comments on commit fd974af

Please sign in to comment.