From: Eric Biggers <ebiggers@kernel.org>
To: Yufen Yu <yuyufen@huawei.com>
Cc: fstests@vger.kernel.org
Subject: Re: [PATCH 1/5] commom/rc: define function _get_max_file_size
Date: Tue, 19 Feb 2019 19:12:07 -0800 [thread overview]
Message-ID: <20190220031206.GA672@sol.localdomain> (raw)
In-Reply-To: <20190220015955.26342-2-yuyufen@huawei.com>
Hi Yufen,
On Wed, Feb 20, 2019 at 09:59:51AM +0800, Yufen Yu wrote:
> Define a new function _get_max_file_size to return
> the max file size supported by the special filesystem.
>
> Signed-off-by: Yufen Yu <yuyufen@huawei.com>
> ---
> common/rc | 23 +++++++++++++++++++++++
> 1 file changed, 23 insertions(+)
>
> diff --git a/common/rc b/common/rc
> index e5da6484..10ab497d 100644
> --- a/common/rc
> +++ b/common/rc
> @@ -3785,6 +3785,29 @@ _require_scratch_feature()
> esac
> }
>
> +# get filesystem max file size
> +_get_max_file_size()
> +{
> + case $FSTYP in
> + vfat|jffs2|romfs)
> + echo $((2**32-1)) # 0xFFFFFFFF
> + ;;
> + *) # MAX_LFS_FILESIZE
> + case "$(getconf LONG_BIT)" in
> + "32")
> + echo $(( ($(getconf PAGE_SIZE) << ($(getconf LONG_BIT) - 1) ) - 1))
> + ;;
> + "64")
> + echo "9223372036854775807"
> + ;;
> + *)
> + _fail "sizeof(long) == $(getconf LONG_BIT)?"
> + ;;
> + esac
> + ;;
> + esac
> +}
Why not move get_max_file_size() from tests/generic/485 to here instead?
- Eric
next prev parent reply other threads:[~2019-02-20 3:12 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 [this message]
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 ` [PATCH 3/5] generic/351: use the common function _get_max_file_size Yufen Yu
2019-02-20 1:59 ` [PATCH 4/5] generic/349: " 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=20190220031206.GA672@sol.localdomain \
--to=ebiggers@kernel.org \
--cc=fstests@vger.kernel.org \
--cc=yuyufen@huawei.com \
/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