From: Jaegeuk Kim via Linux-f2fs-devel <linux-f2fs-devel@lists.sourceforge.net>
To: Zhiguo Niu <niuzhiguo84@gmail.com>
Cc: xiuhong.wang@unisoc.com, Zhiguo Niu <zhiguo.niu@unisoc.com>,
linux-kernel@vger.kernel.org,
linux-f2fs-devel@lists.sourceforge.net
Subject: Re: [f2fs-dev] [PATCH] f2fs-toos: use getpagesize() to get default blocksize in Android
Date: Mon, 7 Oct 2024 16:49:53 +0000 [thread overview]
Message-ID: <ZwQRMe9a6oXKLCq5@google.com> (raw)
In-Reply-To: <CAHJ8P3+=Ft_LOWHXPDdXQnQA=BsGhDLF0KYWWD6T3KHB-TEgWg@mail.gmail.com>
On 09/19, Zhiguo Niu wrote:
> Hi all,
> please ignore this patch, we can resove this by "-b" parameter .
> thanks!
Ok, thanks.
> Zhiguo Niu <zhiguo.niu@unisoc.com> 于2024年9月14日周六 11:12写道:
> >
> > When 16K page/block size is enabled in Android platform,
> > a error maybe detected in mount process in kernel if "-b"
> > parameters is not specified in mkfs.f2fs.
> > Just as the following check:
> > if (le32_to_cpu(raw_super->log_blocksize) != F2FS_BLKSIZE_BITS)
> >
> > So use getpagesize() to get correct default blocksize.
> >
> > Signed-off-by: Zhiguo Niu <zhiguo.niu@unisoc.com>
> > Signed-off-by: Xiuhong Wang <xiuhong.wang@unisoc.com>
> > ---
> > lib/libf2fs.c | 9 +++++++++
> > 1 file changed, 9 insertions(+)
> >
> > diff --git a/lib/libf2fs.c b/lib/libf2fs.c
> > index ecd22d4..98ee0ae 100644
> > --- a/lib/libf2fs.c
> > +++ b/lib/libf2fs.c
> > @@ -685,8 +685,17 @@ void f2fs_init_configuration(void)
> >
> > memset(&c, 0, sizeof(struct f2fs_configuration));
> > c.ndevs = 1;
> > +#ifdef WITH_ANDROID
> > + c.blksize = getpagesize();
> > + c.blksize_bits = log_base_2(c.blksize);
> > + if ((1 << c.blksize_bits) != c.blksize) {
> > + c.blksize = 1 << DEFAULT_BLKSIZE_BITS;
> > + c.blksize_bits = DEFAULT_BLKSIZE_BITS;
> > + }
> > +#else
> > c.blksize = 1 << DEFAULT_BLKSIZE_BITS;
> > c.blksize_bits = DEFAULT_BLKSIZE_BITS;
> > +#endif
> > c.sectors_per_blk = DEFAULT_SECTORS_PER_BLOCK;
> > c.blks_per_seg = DEFAULT_BLOCKS_PER_SEGMENT;
> > c.wanted_total_sectors = -1;
> > --
> > 1.9.1
> >
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
WARNING: multiple messages have this Message-ID (diff)
From: Jaegeuk Kim <jaegeuk@kernel.org>
To: Zhiguo Niu <niuzhiguo84@gmail.com>
Cc: Zhiguo Niu <zhiguo.niu@unisoc.com>,
chao@kernel.org, linux-f2fs-devel@lists.sourceforge.net,
linux-kernel@vger.kernel.org, xiuhong.wang@unisoc.com
Subject: Re: [PATCH] f2fs-toos: use getpagesize() to get default blocksize in Android
Date: Mon, 7 Oct 2024 16:49:53 +0000 [thread overview]
Message-ID: <ZwQRMe9a6oXKLCq5@google.com> (raw)
In-Reply-To: <CAHJ8P3+=Ft_LOWHXPDdXQnQA=BsGhDLF0KYWWD6T3KHB-TEgWg@mail.gmail.com>
On 09/19, Zhiguo Niu wrote:
> Hi all,
> please ignore this patch, we can resove this by "-b" parameter .
> thanks!
Ok, thanks.
> Zhiguo Niu <zhiguo.niu@unisoc.com> 于2024年9月14日周六 11:12写道:
> >
> > When 16K page/block size is enabled in Android platform,
> > a error maybe detected in mount process in kernel if "-b"
> > parameters is not specified in mkfs.f2fs.
> > Just as the following check:
> > if (le32_to_cpu(raw_super->log_blocksize) != F2FS_BLKSIZE_BITS)
> >
> > So use getpagesize() to get correct default blocksize.
> >
> > Signed-off-by: Zhiguo Niu <zhiguo.niu@unisoc.com>
> > Signed-off-by: Xiuhong Wang <xiuhong.wang@unisoc.com>
> > ---
> > lib/libf2fs.c | 9 +++++++++
> > 1 file changed, 9 insertions(+)
> >
> > diff --git a/lib/libf2fs.c b/lib/libf2fs.c
> > index ecd22d4..98ee0ae 100644
> > --- a/lib/libf2fs.c
> > +++ b/lib/libf2fs.c
> > @@ -685,8 +685,17 @@ void f2fs_init_configuration(void)
> >
> > memset(&c, 0, sizeof(struct f2fs_configuration));
> > c.ndevs = 1;
> > +#ifdef WITH_ANDROID
> > + c.blksize = getpagesize();
> > + c.blksize_bits = log_base_2(c.blksize);
> > + if ((1 << c.blksize_bits) != c.blksize) {
> > + c.blksize = 1 << DEFAULT_BLKSIZE_BITS;
> > + c.blksize_bits = DEFAULT_BLKSIZE_BITS;
> > + }
> > +#else
> > c.blksize = 1 << DEFAULT_BLKSIZE_BITS;
> > c.blksize_bits = DEFAULT_BLKSIZE_BITS;
> > +#endif
> > c.sectors_per_blk = DEFAULT_SECTORS_PER_BLOCK;
> > c.blks_per_seg = DEFAULT_BLOCKS_PER_SEGMENT;
> > c.wanted_total_sectors = -1;
> > --
> > 1.9.1
> >
next prev parent reply other threads:[~2024-10-07 16:50 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-14 3:11 [f2fs-dev] [PATCH] f2fs-toos: use getpagesize() to get default blocksize in Android Zhiguo Niu
2024-09-14 3:11 ` Zhiguo Niu
2024-09-19 1:23 ` [f2fs-dev] " Zhiguo Niu
2024-09-19 1:23 ` Zhiguo Niu
2024-10-07 16:49 ` Jaegeuk Kim via Linux-f2fs-devel [this message]
2024-10-07 16:49 ` Jaegeuk Kim
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=ZwQRMe9a6oXKLCq5@google.com \
--to=linux-f2fs-devel@lists.sourceforge.net \
--cc=jaegeuk@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=niuzhiguo84@gmail.com \
--cc=xiuhong.wang@unisoc.com \
--cc=zhiguo.niu@unisoc.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.