]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
btrfs/081: declare local variables as local
authorFilipe Manana <fdmanana@suse.com>
Fri, 25 Jan 2019 11:46:11 +0000 (11:46 +0000)
committerEryu Guan <guaneryu@gmail.com>
Sun, 27 Jan 2019 05:18:46 +0000 (13:18 +0800)
Some variables inside the test's functions were used as local but
were not being declared as such. Add the local declaration for them.

Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
tests/btrfs/081

index dc357e53850289ae153f6357ac34bc8fa0cd939e..7e83525f74f33058ecfb248bf1aa4a43284d8551 100755 (executable)
@@ -45,7 +45,7 @@ extent_size=8192
 
 create_source_file()
 {
-       name=$1
+       local name=$1
 
        # Create a file with $num_extents extents, each with a size of
        # $extent_size bytes.
@@ -60,8 +60,8 @@ create_source_file()
 
 create_target_file()
 {
-       name=$1
-       file_size=$(($num_extents * $extent_size))
+       local name=$1
+       local file_size=$(($num_extents * $extent_size))
 
        $XFS_IO_PROG -f -c "pwrite -S 0xff 0 $file_size" \
                -c "fsync" $SCRATCH_MNT/$name | _filter_xfs_io
@@ -69,7 +69,7 @@ create_target_file()
 
 reader_loop()
 {
-       name=$1
+       local name=$1
 
        while true; do
                cat $SCRATCH_MNT/$name > /dev/null