Linux Device Mapper development
 help / color / mirror / Atom feed
* [PATCH 0/4] dm unstriped: support non power of 2 chunk size...
@ 2018-02-01 18:06 Heinz Mauelshagen
  2018-02-01 18:06 ` [PATCH 1/4] " Heinz Mauelshagen
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Heinz Mauelshagen @ 2018-02-01 18:06 UTC (permalink / raw)
  To: heinzm, dm-devel, snitzer

Patch series adds support for non power of 2 chunk size to
the "unstriped" target to better suit the striped target
in patch 1.

Patches 2-4 remove the module init error path message,
rename symbols to conform to the target name and avoid
unnecessary headers.


Test script:
------------
#!/bin/sh
#
# Test "unstriped" target non power of 2 chunk size support.
#
# Requires precreated "striped" logical volume as backing device.
# Device will be overwritten!
#
po2=0 # adjust to 1 = power of2, 0 = non-po2
dev=/dev/$vg/$lv # "striped" backing device; adjust to exisiting "striped" LV

table=`dmsetup table $dev`
size=`echo "$table"|awk '{print $2}'`
stripes=`echo "$table"|awk '{print $4}'`
stripesize=`echo "$table"|awk '{print $5}'`
bdstripesize=$stripesize

[ $po2 -eq 0 ] && stripesize=$(($stripesize - 9))
len=$(($size / $stripes / $stripesize * $stripesize))

if [ $po2 -eq 0 ]
then
	dmsetup table $dev | sed "s/$size/$(($len * $stripes))/;s/$bdstripesize/$stripesize/" | dmsetup load $dev
	dmsetup suspend $dev ; dmsetup resume $dev
fi

echo y | mkfs -t ext4 $dev
fsck -fn $dev

devs=""
for i in `seq 0 $(($stripes - 1))`
do
	echo "0 $len unstriped $stripes $stripesize $i $dev 0" | dmsetup create s-$i
	devs="$devs /dev/mapper/s-$i 0"
done

dmsetup create `basename $dev` --table "0 $(($len * $stripes)) striped $stripes $stripesize $devs"
fsck -fn /dev/mapper/`basename $dev`


Example mapping tables resulting from script:
---------------------------------------------
# dmsetup table|egrep "^(nvm-s|s)"
s: 0 270249 striped 3 119 254:7 0 254:8 0 254:9 0
s-2: 0 90083 unstriped 3 119 2 254:6 0
s-1: 0 90083 unstriped 3 119 1 254:6 0
s-0: 0 90083 unstriped 3 119 0 254:6 0
nvm-s: 0 270249 striped 3 119 66:96 13854720 66:64 2048 66:48 2048



Signed-off-by: Heinz Mauelshagen <heinzm@redhat.com>

Heinz Mauelshagen (4):
  dm unstriped: support non power of 2 chunk size
  dm unstriped: remove superfluous module init error path message
  dm unstriped: rename symbols to conform to target name
  dm unstriped: remove unnecessary header includes

 Documentation/device-mapper/unstriped.txt |   5 ++
 drivers/md/dm-unstripe.c                  | 109 +++++++++++++-----------------
 2 files changed, 53 insertions(+), 61 deletions(-)

-- 
2.14.3

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2018-02-22 16:41 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-01 18:06 [PATCH 0/4] dm unstriped: support non power of 2 chunk size Heinz Mauelshagen
2018-02-01 18:06 ` [PATCH 1/4] " Heinz Mauelshagen
2018-02-06 18:02   ` Scott Bauer
2018-02-01 18:06 ` [PATCH 2/4] dm unstriped: remove superfluous module init error path message Heinz Mauelshagen
2018-02-06 18:03   ` Scott Bauer
2018-02-01 18:06 ` [PATCH 3/4] dm unstriped: rename symbols to conform to target name Heinz Mauelshagen
2018-02-22 16:41   ` Mike Snitzer
2018-02-01 18:06 ` [PATCH 4/4] dm unstriped: remove unnecessary header includes Heinz Mauelshagen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox