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 04-28-2012, 04:44 AM
Mike Snitzer
 
Default dm: update max_io_len to support a split_io that is not a power of 2

Required to support a target's use of a non power of 2 blocksize.

Signed-off-by: Mike Snitzer <snitzer@redhat.com>
---
drivers/md/dm.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/md/dm.c b/drivers/md/dm.c
index e24143c..fe57285 100644
--- a/drivers/md/dm.c
+++ b/drivers/md/dm.c
@@ -973,10 +973,10 @@ static sector_t max_io_len(sector_t sector, struct dm_target *ti)
* Does the target need to split even further ?
*/
if (ti->split_io) {
- sector_t boundary;
sector_t offset = dm_target_offset(ti, sector);
- boundary = ((offset + ti->split_io) & ~(ti->split_io - 1))
- - offset;
+ sector_t boundary, tmp = offset + ti->split_io;
+
+ boundary = ti->split_io - do_div(tmp, ti->split_io);
if (len > boundary)
len = boundary;
}
--
1.7.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 05:13 PM.

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