From: Gao Xiang <hsiangkao@linux.alibaba.com>
To: Yangtao Li <frank.li@vivo.com>, zbestahu@gmail.com
Cc: chao@kernel.org, huyue2@coolpad.com, jefflexu@linux.alibaba.com,
linux-erofs@lists.ozlabs.org, linux-kernel@vger.kernel.org,
xiang@kernel.org, zhangwen@coolpad.com
Subject: Re: erofs: use wrapper i_blocksize() in erofs_file_read_iter()
Date: Thu, 9 Mar 2023 16:09:53 +0800 [thread overview]
Message-ID: <bcecc8fe-8e98-fe2f-2a7c-2eac51cdbc9c@linux.alibaba.com> (raw)
In-Reply-To: <20230309074225.29404-1-frank.li@vivo.com>
On 2023/3/9 15:42, Yangtao Li wrote:
>> FYI it seems that GENMASK macro is widely used in driver and arch code base, while it's rarely used in fs, except for f2fs.
>
> I think the following usage can be changed to bitmap api, just like in f2fs?
> https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=c4ca1f7164734a1baf40d4ff1552172a07d4fc4d
>
> fs/erofs/fscache.c:135: unsigned long flags = 1 << NETFS_SREQ_ONDEMAND;
> fs/erofs/internal.h:250:#define SECTORS_PER_BLOCK (1 << SECTORS_PER_BLOCK)
> fs/erofs/internal.h:252:#define EROFS_BLKSIZ (1 << LOG_BLOCK_SIZE)
> fs/erofs/internal.h:354: return (value >> bit) & ((1 << bits) - 1);
> fs/erofs/zmap.c:66: ((1 << Z_EROFS_VLE_DI_CLUSTER_TYPE_BITS) - 1);
> fs/erofs/zmap.c:69: m->clusterofs = 1 << vi->z_logical_clusterbits;
> fs/erofs/zmap.c:114: const unsigned int lomask = (1 << lclusterbits) - 1;
> fs/erofs/zmap.c:141: const unsigned int lomask = (1 << lclusterbits) - 1;
> fs/erofs/zmap.c:147: if (1 << amortizedshift == 4)
> fs/erofs/zmap.c:149: else if (1 << amortizedshift == 2 && lclusterbits == 12)
> fs/erofs/zmap.c:169: m->clusterofs = 1 << lclusterbits;
> fs/erofs/zmap.c:291: pos += lcn * (1 << amortizedshift);
> fs/erofs/zmap.c:409: m->compressedblks = 1 << (lclusterbits - LOG_BLOCK_SIZE);
> fs/erofs/zmap.c:457: m->clusterofs != 1 << lclusterbits);
> fs/erofs/zmap.c:497: endoff = ofs & ((1 << lclusterbits) - 1);
> fs/erofs/erofs_fs.h:120: ((1 << (EROFS_I_DATALAYOUT_BIT + EROFS_I_DATALAYOUT_BITS)) - 1)
> fs/erofs/erofs_fs.h:279:#define Z_EROFS_ALL_COMPR_ALGS ((1 << Z_EROFS_COMPRESSION_MAX) - 1)
> fs/erofs/erofs_fs.h:377:#define Z_EROFS_VLE_DI_PARTIAL_REF (1 << 15)
> fs/erofs/erofs_fs.h:384:#define Z_EROFS_VLE_DI_D0_CBLKCNT (1 << 11)
> fs/erofs/erofs_fs.h:427: .h_clusterbits = 1 << Z_EROFS_FRAGMENT_INODE_BIT
> fs/erofs/data.c:379: blksize_mask = (1 << inode->i_blkbits) - 1;
> fs/erofs/zdata.c:133:#define Z_EROFS_PAGE_EIO (1 << 30)
>
Is there some benefit to use these? BIT(1) vs 1 << 1? also almost all
filesystems rarely use such APIs honestly.
Thanks,
Gao Xiang
> Thx,
> Yangtao
next prev parent reply other threads:[~2023-03-09 8:11 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-06 7:55 [PATCH] erofs: use wrapper i_blocksize() in erofs_file_read_iter() Yue Hu
2023-03-06 14:46 ` Gao Xiang
2023-03-09 7:15 ` Yangtao Li
2023-03-09 7:36 ` Jingbo Xu
2023-03-09 7:42 ` Yangtao Li
2023-03-09 8:09 ` Gao Xiang [this message]
2023-03-09 7:37 ` Yue Hu
2023-03-09 8:07 ` Gao Xiang
2023-03-09 14:33 ` [PATCH] " Chao 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=bcecc8fe-8e98-fe2f-2a7c-2eac51cdbc9c@linux.alibaba.com \
--to=hsiangkao@linux.alibaba.com \
--cc=chao@kernel.org \
--cc=frank.li@vivo.com \
--cc=huyue2@coolpad.com \
--cc=jefflexu@linux.alibaba.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