mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jingbo Xu <jefflexu@linux.alibaba.com>
To: Yue Hu <zbestahu@gmail.com>
Cc: xiang@kernel.org, chao@kernel.org, linux-erofs@lists.ozlabs.org,
	linux-kernel@vger.kernel.org, huyue2@coolpad.com,
	zhangwen@coolpad.com
Subject: Re: [PATCH v4 1/2] erofs: avoid hardcoded blocksize for subpage block support
Date: Mon, 6 Mar 2023 17:45:01 +0800	[thread overview]
Message-ID: <19551cbd-f4b9-b53a-bbfb-08c88b81321b@linux.alibaba.com> (raw)
In-Reply-To: <20230306151606.00000ebd.zbestahu@gmail.com>



On 3/6/23 3:16 PM, Yue Hu wrote:
> On Thu,  2 Mar 2023 22:39:14 +0800
> Jingbo Xu <jefflexu@linux.alibaba.com> wrote:
> 
>> As the first step of converting hardcoded blocksize to that specified in
>> on-disk superblock, convert all call sites of hardcoded blocksize to
>> sb->s_blocksize except for:
>>
>> 1) use sbi->blkszbits instead of sb->s_blocksize in
>> erofs_superblock_csum_verify() since sb->s_blocksize has not been
>> updated with the on-disk blocksize yet when the function is called.
>>
>> 2) use inode->i_blkbits instead of sb->s_blocksize in erofs_bread(),
>> since the inode operated on may be an anonymous inode in fscache mode.
>> Currently the anonymous inode is allocated from an anonymous mount
>> maintained in erofs, while in the near future we may allocate anonymous
>> inodes from a generic API directly and thus have no access to the
>> anonymous inode's i_sb.  Thus we keep the block size in i_blkbits for
>> anonymous inodes in fscache mode.
>>
>> Be noted that this patch only gets rid of the hardcoded blocksize, in
>> preparation for actually setting the on-disk block size in the following
>> patch.  The hard limit of constraining the block size to PAGE_SIZE still
>> exists until the next patch.
>>
>> Signed-off-by: Jingbo Xu <jefflexu@linux.alibaba.com>
>> Reviewed-by: Gao Xiang <hsiangkao@linux.alibaba.com>
>> ---
>> diff --git a/fs/erofs/decompressor.c b/fs/erofs/decompressor.c
>> index 51b7ac7166d9..21fc6897d225 100644
>> --- a/fs/erofs/decompressor.c
>> +++ b/fs/erofs/decompressor.c
>> @@ -42,7 +42,7 @@ int z_erofs_load_lz4_config(struct super_block *sb,
>>  		if (!sbi->lz4.max_pclusterblks) {
>>  			sbi->lz4.max_pclusterblks = 1;	/* reserved case */
>>  		} else if (sbi->lz4.max_pclusterblks >
>> -			   Z_EROFS_PCLUSTER_MAX_SIZE / EROFS_BLKSIZ) {
>> +			   Z_EROFS_PCLUSTER_MAX_SIZE >> sb->s_blocksize_bits) {
> 
> erofs_blknr(sb, Z_EROFS_PCLUSTER_MAX_SIZE)?

Okay.

>> @@ -422,7 +423,7 @@ static int z_erofs_get_extent_compressedlen(struct z_erofs_maprecorder *m,
>>  		return -EFSCORRUPTED;
>>  	}
>>  out:
>> -	map->m_plen = (u64)m->compressedblks << LOG_BLOCK_SIZE;
>> +	map->m_plen = (u64)m->compressedblks << sb->s_blocksize_bits;
> 
> erofs_pos(sb, m->compressedblks)?

Okay.  I will update all these in the next version.

Thanks for the comment!


-- 
Thanks,
Jingbo

  reply	other threads:[~2023-03-06  9:45 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-02 14:39 [PATCH v4 0/2] erofs: set block size to the on-disk block size Jingbo Xu
2023-03-02 14:39 ` [PATCH v4 1/2] erofs: avoid hardcoded blocksize for subpage block support Jingbo Xu
2023-03-06  7:16   ` Yue Hu
2023-03-06  9:45     ` Jingbo Xu [this message]
2023-03-02 14:39 ` [PATCH v4 2/2] erofs: set block size to the on-disk block size Jingbo Xu
2023-03-03  0:38   ` Gao Xiang
2023-03-06  7:31   ` Yue Hu
2023-03-06  9:52     ` Jingbo Xu

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=19551cbd-f4b9-b53a-bbfb-08c88b81321b@linux.alibaba.com \
    --to=jefflexu@linux.alibaba.com \
    --cc=chao@kernel.org \
    --cc=huyue2@coolpad.com \
    --cc=linux-erofs@lists.ozlabs.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=xiang@kernel.org \
    --cc=zbestahu@gmail.com \
    --cc=zhangwen@coolpad.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

all inboxes | Powered by JetHome®