linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ritesh Harjani <riteshh@linux.ibm.com>
To: fstests <fstests@vger.kernel.org>
Cc: linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Ritesh Harjani <riteshh@linux.ibm.com>
Subject: [PATCHv2 2/4] common/punch: Add block_size argument to _filter_fiemap_**
Date: Tue, 15 Mar 2022 19:58:57 +0530	[thread overview]
Message-ID: <074f560c97fba2be9ff367ab9b4b7963ba23fe4b.1647342932.git.riteshh@linux.ibm.com> (raw)
In-Reply-To: <cover.1647342932.git.riteshh@linux.ibm.com>

Add block_size paramter to _filter_fiemap_flags() and
_filter_hole_fiemap(). This is used in next patches

Also this fixes some of the end of line whitespace issues while we are
at it.

Signed-off-by: Ritesh Harjani <riteshh@linux.ibm.com>
---
 common/punch | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/common/punch b/common/punch
index b6b8a0b9..f99e21ad 100644
--- a/common/punch
+++ b/common/punch
@@ -109,6 +109,7 @@ _filter_fiemap()

 _filter_fiemap_flags()
 {
+	block_size=$1
 	$AWK_PROG '
 		$3 ~ /hole/ {
 			print $1, $2, $3;
@@ -135,23 +136,24 @@ _filter_fiemap_flags()
 			}
 			print $1, $2, flag_str
 		}' |
-	_coalesce_extents
+	_coalesce_extents $block_size
 }

-# Filters fiemap output to only print the
+# Filters fiemap output to only print the
 # file offset column and whether or not
 # it is an extent or a hole
 _filter_hole_fiemap()
 {
+	block_size=$1
 	$AWK_PROG '
 		$3 ~ /hole/ {
-			print $1, $2, $3;
+			print $1, $2, $3;
 			next;
-		}
+		}
 		$5 ~ /0x[[:xdigit:]]+/ {
 			print $1, $2, "extent";
 		}' |
-	_coalesce_extents
+	_coalesce_extents $block_size
 }

 #     10000 Unwritten preallocated extent
--
2.31.1


  parent reply	other threads:[~2022-03-15 14:29 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-15 14:28 [PATCHv2 0/4] generic: Add some tests around journal replay/recoveryloop Ritesh Harjani
2022-03-15 14:28 ` [PATCHv2 1/4] generic/468: Add another falloc test entry Ritesh Harjani
2022-03-15 16:51   ` Darrick J. Wong
2022-03-29 10:59     ` Ritesh Harjani
2022-03-15 14:28 ` Ritesh Harjani [this message]
2022-03-15 14:28 ` [PATCHv2 3/4] generic/676: Add a new shutdown recovery test Ritesh Harjani
2022-03-15 16:55   ` Darrick J. Wong
2022-03-29 11:32     ` Ritesh Harjani
2022-03-31  9:49       ` Ritesh Harjani
2022-03-15 14:28 ` [PATCHv2 4/4] generic/677: Add a test to check unwritten extents tracking Ritesh Harjani
2022-03-15 16:56   ` Darrick J. Wong
2022-03-29 11:34     ` Ritesh Harjani

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=074f560c97fba2be9ff367ab9b4b7963ba23fe4b.1647342932.git.riteshh@linux.ibm.com \
    --to=riteshh@linux.ibm.com \
    --cc=fstests@vger.kernel.org \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).