lkml.org 
[lkml]   [2022]   [Mar]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCHv2 2/4] common/punch: Add block_size argument to _filter_fiemap_**
Date
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
\
 
 \ /
  Last update: 2022-03-15 15:30    [W:0.112 / U:0.080 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site