Linux-BTRFS Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH 1/2] fstests: btrfs/081 declare local variables as local
@ 2019-01-25 11:46 fdmanana
  0 siblings, 0 replies; only message in thread
From: fdmanana @ 2019-01-25 11:46 UTC (permalink / raw)
  To: fstests; +Cc: linux-btrfs, Filipe Manana

From: Filipe Manana <fdmanana@suse.com>

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>
---
 tests/btrfs/081 | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/tests/btrfs/081 b/tests/btrfs/081
index dc357e53..7e83525f 100755
--- a/tests/btrfs/081
+++ b/tests/btrfs/081
@@ -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
-- 
2.11.0


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, back to index

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-25 11:46 [PATCH 1/2] fstests: btrfs/081 declare local variables as local fdmanana

Linux-BTRFS Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-btrfs/0 linux-btrfs/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-btrfs linux-btrfs/ https://lore.kernel.org/linux-btrfs \
		linux-btrfs@vger.kernel.org linux-btrfs@archiver.kernel.org
	public-inbox-index linux-btrfs


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-btrfs


AGPL code for this site: git clone https://public-inbox.org/ public-inbox