From: Yufen Yu <yuyufen@huawei.com>
To: fstests@vger.kernel.org
Subject: [PATCH 3/5] generic/351: use the common function _get_max_file_size
Date: Wed, 20 Feb 2019 09:59:53 +0800 [thread overview]
Message-ID: <20190220015955.26342-4-yuyufen@huawei.com> (raw)
In-Reply-To: <20190220015955.26342-1-yuyufen@huawei.com>
We use common function _get_max_file_size to get the max
file size supported by the filesystems and let the code
be clean.
Signed-off-by: Yufen Yu <yuyufen@huawei.com>
---
tests/generic/351 | 13 ++-----------
1 file changed, 2 insertions(+), 11 deletions(-)
diff --git a/tests/generic/351 b/tests/generic/351
index e326dca1..5fd7c303 100755
--- a/tests/generic/351
+++ b/tests/generic/351
@@ -62,17 +62,8 @@ $XFS_IO_PROG -c "fpunch 512 512" $dev
echo "Zero range past MAX_LFS_FILESIZE keep size"
# zod = MAX_LFS_FILESIZE
-case "$(getconf LONG_BIT)" in
-"32")
- zod=$(( ($(getconf PAGE_SIZE) << ($(getconf LONG_BIT) - 1) ) - 1))
- ;;
-"64")
- zod=9223372036854775807
- ;;
-*)
- _fail "sizeof(long) == $(getconf LONG_BIT)?"
- ;;
-esac
+zod=$(_get_max_file_size)
+
$XFS_IO_PROG -c "fzero -k 512k $zod" $dev
echo "Zero range past MAX_LFS_FILESIZE"
--
2.16.2.dirty
next prev parent reply other threads:[~2019-02-20 1:55 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-20 1:59 [PATCH 0/5] define common _get_max_file_size function Yufen Yu
2019-02-20 1:59 ` [PATCH 1/5] commom/rc: define function _get_max_file_size Yufen Yu
2019-02-20 3:12 ` Eric Biggers
2019-02-20 13:32 ` Eryu Guan
2019-02-20 1:59 ` [PATCH 2/5] generic/299: limit max file size Yufen Yu
2019-02-20 1:59 ` Yufen Yu [this message]
2019-02-20 1:59 ` [PATCH 4/5] generic/349: use the common function _get_max_file_size Yufen Yu
2019-02-20 1:59 ` [PATCH 5/5] generic/350: " Yufen Yu
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=20190220015955.26342-4-yuyufen@huawei.com \
--to=yuyufen@huawei.com \
--cc=fstests@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