search for: i_size_read_inode

Displaying 4 results from an estimated 4 matches for "i_size_read_inode".

2023 Mar 10
3
[PATCH v3 2/6] erofs: convert to use i_blockmask()
On Thu, Mar 09, 2023 at 11:21:23PM +0800, Yangtao Li wrote: > Use i_blockmask() to simplify code. Umm... What's the branchpoint for that series? Not the mainline - there we have i_blocksize() open-coded... > Signed-off-by: Yangtao Li <frank.li at vivo.com> > --- > v3: > -none > v2: > -convert to i_blockmask() > fs/erofs/data.c | 2 +- > 1 file changed, 1
2023 Mar 10
1
[PATCH v3 4/6] ext4: convert to use i_blockmask()
...> { > struct inode *inode = mpd->inode; > int err; > - ext4_lblk_t blocks = (i_size_read(inode) + i_blocksize(inode) - 1) > + ext4_lblk_t blocks = (i_size_read(inode) + i_blockmask(inode)) > >> inode->i_blkbits; Umm... That actually asks for DIV_ROUND_UP(i_size_read_inode(), i_blocksize(inode)) - compiler should bloody well be able to figure out that division by (1 << n) is shift down by n and it's easier to follow that way...
2023 Mar 10
1
erofs: convert to use i_blockmask()
...ize() open-coded... > > Sorry, I'm based on the latest branch of the erofs repository. > > https://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git/log/?h=dev-test > > I think I can resend based on mainline. > > > Umm... That actually asks for DIV_ROUND_UP(i_size_read_inode(), i_blocksize(inode)) > > - compiler should bloody well be able to figure out that division by (1 << n) > > is shift down by n and it's easier to follow that way... > > So it seems better to change to DIV_ROUND_UP(i_size_read_inode(), i_blocksize(inode))? > > &g...
2023 Mar 09
8
[PATCH v3 1/6] fs: add i_blockmask()
Introduce i_blockmask() to simplify code, which replace (i_blocksize(node) - 1). Like done in commit 93407472a21b("fs: add i_blocksize()"). Signed-off-by: Yangtao Li <frank.li at vivo.com> --- v3: -none v2: -convert to i_blockmask() include/linux/fs.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/linux/fs.h b/include/linux/fs.h index c85916e9f7db..17387d465b8b