Commit 95f21c5c authored by Michael Witten's avatar Michael Witten Committed by Jiri Kosina

Documentation/device-mapper: s/getsize/getsz/

According to `man blockdev':

  --getsize
         Print device size (32-bit!) in sectors.
         Deprecated in favor of the --getsz option.
  ...
  --getsz
         Get size in 512-byte sectors.

Hence, occurrences of `--getsize' should be replaced with `--getsz',
which this commit has achieved as follows:

  $ cd "$repo"
  $ git grep -l -e --getsz
  Documentation/device-mapper/delay.txt
  Documentation/device-mapper/dm-crypt.txt
  Documentation/device-mapper/linear.txt
  Documentation/device-mapper/log-writes.txt
  Documentation/device-mapper/striped.txt
  Documentation/device-mapper/switch.txt
  $ cd Documentation/device-mapper
  $ sed -i s/getsize/getsz/g *
Signed-off-by: default avatarMichael Witten <mfwitten@gmail.com>
Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
parent 3e5de27e
...@@ -16,12 +16,12 @@ Example scripts ...@@ -16,12 +16,12 @@ Example scripts
[[ [[
#!/bin/sh #!/bin/sh
# Create device delaying rw operation for 500ms # Create device delaying rw operation for 500ms
echo "0 `blockdev --getsize $1` delay $1 0 500" | dmsetup create delayed echo "0 `blockdev --getsz $1` delay $1 0 500" | dmsetup create delayed
]] ]]
[[ [[
#!/bin/sh #!/bin/sh
# Create device delaying only write operation for 500ms and # Create device delaying only write operation for 500ms and
# splitting reads and writes to different devices $1 $2 # splitting reads and writes to different devices $1 $2
echo "0 `blockdev --getsize $1` delay $1 0 0 $2 0 500" | dmsetup create delayed echo "0 `blockdev --getsz $1` delay $1 0 0 $2 0 500" | dmsetup create delayed
]] ]]
...@@ -85,7 +85,7 @@ https://gitlab.com/cryptsetup/cryptsetup ...@@ -85,7 +85,7 @@ https://gitlab.com/cryptsetup/cryptsetup
[[ [[
#!/bin/sh #!/bin/sh
# Create a crypt device using dmsetup # Create a crypt device using dmsetup
dmsetup create crypt1 --table "0 `blockdev --getsize $1` crypt aes-cbc-essiv:sha256 babebabebabebabebabebabebabebabe 0 $1 0" dmsetup create crypt1 --table "0 `blockdev --getsz $1` crypt aes-cbc-essiv:sha256 babebabebabebabebabebabebabebabe 0 $1 0"
]] ]]
[[ [[
......
...@@ -16,15 +16,15 @@ Example scripts ...@@ -16,15 +16,15 @@ Example scripts
[[ [[
#!/bin/sh #!/bin/sh
# Create an identity mapping for a device # Create an identity mapping for a device
echo "0 `blockdev --getsize $1` linear $1 0" | dmsetup create identity echo "0 `blockdev --getsz $1` linear $1 0" | dmsetup create identity
]] ]]
[[ [[
#!/bin/sh #!/bin/sh
# Join 2 devices together # Join 2 devices together
size1=`blockdev --getsize $1` size1=`blockdev --getsz $1`
size2=`blockdev --getsize $2` size2=`blockdev --getsz $2`
echo "0 $size1 linear $1 0 echo "0 $size1 linear $1 0
$size1 $size2 linear $2 0" | dmsetup create joined $size1 $size2 linear $2 0" | dmsetup create joined
]] ]]
...@@ -44,7 +44,7 @@ if (!defined($dev)) { ...@@ -44,7 +44,7 @@ if (!defined($dev)) {
die("Please specify a device.\n"); die("Please specify a device.\n");
} }
my $dev_size = `blockdev --getsize $dev`; my $dev_size = `blockdev --getsz $dev`;
my $extents = int($dev_size / $extent_size) - my $extents = int($dev_size / $extent_size) -
(($dev_size % $extent_size) ? 1 : 0); (($dev_size % $extent_size) ? 1 : 0);
......
...@@ -37,9 +37,9 @@ if (!$num_devs) { ...@@ -37,9 +37,9 @@ if (!$num_devs) {
die("Specify at least one device\n"); die("Specify at least one device\n");
} }
$min_dev_size = `blockdev --getsize $devs[0]`; $min_dev_size = `blockdev --getsz $devs[0]`;
for ($i = 1; $i < $num_devs; $i++) { for ($i = 1; $i < $num_devs; $i++) {
my $this_size = `blockdev --getsize $devs[$i]`; my $this_size = `blockdev --getsz $devs[$i]`;
$min_dev_size = ($min_dev_size < $this_size) ? $min_dev_size = ($min_dev_size < $this_size) ?
$min_dev_size : $this_size; $min_dev_size : $this_size;
} }
......
...@@ -123,7 +123,7 @@ Assume that you have volumes vg1/switch0 vg1/switch1 vg1/switch2 with ...@@ -123,7 +123,7 @@ Assume that you have volumes vg1/switch0 vg1/switch1 vg1/switch2 with
the same size. the same size.
Create a switch device with 64kB region size: Create a switch device with 64kB region size:
dmsetup create switch --table "0 `blockdev --getsize /dev/vg1/switch0` dmsetup create switch --table "0 `blockdev --getsz /dev/vg1/switch0`
switch 3 128 0 /dev/vg1/switch0 0 /dev/vg1/switch1 0 /dev/vg1/switch2 0" switch 3 128 0 /dev/vg1/switch0 0 /dev/vg1/switch1 0 /dev/vg1/switch2 0"
Set mappings for the first 7 entries to point to devices switch0, switch1, Set mappings for the first 7 entries to point to devices switch0, switch1,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment