FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Device-mapper Development

 
 
LinkBack Thread Tools
 
Old 07-16-2012, 06:34 PM
Mikulas Patocka
 
Default dm: introduce split_discard_requests

dm: introduce split_discard_requests

This patch introduces a new variable split_discard_requests. It can be
set by targets, when it is set, discard requests are split on max_io_len
boundary.

When split_discard_requests is not set, discard requests are split on
target boundary, as it used to be before this patch.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>

---
drivers/md/dm.c | 5 ++++-
include/linux/device-mapper.h | 6 ++++++
2 files changed, 10 insertions(+), 1 deletion(-)

Index: linux-3.4.4-fast/drivers/md/dm.c
================================================== =================
--- linux-3.4.4-fast.orig/drivers/md/dm.c 2012-07-05 23:55:38.000000000 +0200
+++ linux-3.4.4-fast/drivers/md/dm.c 2012-07-05 23:56:41.000000000 +0200
@@ -1244,7 +1244,10 @@ static int __clone_and_map_discard(struc
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);

Index: linux-3.4.4-fast/include/linux/device-mapper.h
================================================== =================
--- linux-3.4.4-fast.orig/include/linux/device-mapper.h 2012-07-05 23:53:47.000000000 +0200
+++ linux-3.4.4-fast/include/linux/device-mapper.h 2012-07-05 23:59:37.000000000 +0200
@@ -220,6 +220,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.
*/
unsigned discard_zeroes_data_unsupported:1;

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
 

Thread Tools




All times are GMT. The time now is 09:38 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org