All of lore.kernel.org
 help / color / mirror / Atom feed
From: Heinz Mauelshagen <heinzm@redhat.com>
To: heinzm@redhat.com, dm-devel@redhat.com, snitzer@redhat.com
Subject: [PATCH 0/4] dm unstriped: support non power of 2 chunk size...
Date: Thu,  1 Feb 2018 19:06:08 +0100	[thread overview]
Message-ID: <cover.1517504857.git.heinzm@redhat.com> (raw)

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

             reply	other threads:[~2018-02-01 18:06 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-01 18:06 Heinz Mauelshagen [this message]
2018-02-01 18:06 ` [PATCH 1/4] dm unstriped: support non power of 2 chunk size 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cover.1517504857.git.heinzm@redhat.com \
    --to=heinzm@redhat.com \
    --cc=dm-devel@redhat.com \
    --cc=snitzer@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.