* [PATCH] generic/619: a better way to get tot_avail_size
@ 2021-04-15 4:51 Sun Ke
2021-04-18 10:59 ` Eryu Guan
0 siblings, 1 reply; 2+ messages in thread
From: Sun Ke @ 2021-04-15 4:51 UTC (permalink / raw)
To: fstests; +Cc: sunke32
When FSTYP is tmpfs, $DF_PROG --block-size=1 $SCRATCH_DEV is not suitted.
Signei-off-by: Sun Ke <sunke32@huawei.com>
---
tests/generic/619 | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/generic/619 b/tests/generic/619
index 3c43fe746917..76d6b2c470b9 100755
--- a/tests/generic/619
+++ b/tests/generic/619
@@ -89,7 +89,7 @@ calc_thread_cnt()
IFS=',' read -ra fratio <<< $file_ratio
file_ratio_cnt=${#fratio[@]}
- tot_avail_size=$($DF_PROG --block-size=1 $SCRATCH_DEV | awk 'FNR == 2 { print $5 }')
+ tot_avail_size=$(echo $($DF_PROG | grep -w $SCRATCH_DEV | awk '{print $5}')*1024 | $BC_PROG)
avail_size=$(echo $tot_avail_size*$disk_saturation | $BC_PROG)
thread_cnt=$(echo "$file_ratio_cnt*($avail_size/$file_ratio_unit)" | $BC_PROG)
--
2.25.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] generic/619: a better way to get tot_avail_size
2021-04-15 4:51 [PATCH] generic/619: a better way to get tot_avail_size Sun Ke
@ 2021-04-18 10:59 ` Eryu Guan
0 siblings, 0 replies; 2+ messages in thread
From: Eryu Guan @ 2021-04-18 10:59 UTC (permalink / raw)
To: Sun Ke; +Cc: fstests
On Thu, Apr 15, 2021 at 12:51:02AM -0400, Sun Ke wrote:
> When FSTYP is tmpfs, $DF_PROG --block-size=1 $SCRATCH_DEV is not suitted.
>
> Signei-off-by: Sun Ke <sunke32@huawei.com>
> ---
> tests/generic/619 | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tests/generic/619 b/tests/generic/619
> index 3c43fe746917..76d6b2c470b9 100755
> --- a/tests/generic/619
> +++ b/tests/generic/619
> @@ -89,7 +89,7 @@ calc_thread_cnt()
> IFS=',' read -ra fratio <<< $file_ratio
> file_ratio_cnt=${#fratio[@]}
>
> - tot_avail_size=$($DF_PROG --block-size=1 $SCRATCH_DEV | awk 'FNR == 2 { print $5 }')
Does s/$SCRATCH_DEV/$SCRATCH_MNT/ work for you? And please replace 'awk'
with $AWK_PROG while we're at it.
Thanks,
Eryu
> + tot_avail_size=$(echo $($DF_PROG | grep -w $SCRATCH_DEV | awk '{print $5}')*1024 | $BC_PROG)
> avail_size=$(echo $tot_avail_size*$disk_saturation | $BC_PROG)
> thread_cnt=$(echo "$file_ratio_cnt*($avail_size/$file_ratio_unit)" | $BC_PROG)
>
> --
> 2.25.4
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-04-18 10:59 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-15 4:51 [PATCH] generic/619: a better way to get tot_avail_size Sun Ke
2021-04-18 10:59 ` Eryu Guan
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).