linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ext4: convert to DIV_ROUND_UP() in mpage_process_page_bufs()
@ 2023-03-10  6:07 Yangtao Li
  2023-03-10  6:17 ` Eric Biggers
                   ` (3 more replies)
  0 siblings, 4 replies; 18+ messages in thread
From: Yangtao Li @ 2023-03-10  6:07 UTC (permalink / raw)
  To: tytso, adilger.kernel; +Cc: linux-ext4, linux-kernel, viro, Yangtao Li

Just for better readability, no code logic change.

Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
 fs/ext4/inode.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index d251d705c276..d121cde74522 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -2218,8 +2218,7 @@ static int mpage_process_page_bufs(struct mpage_da_data *mpd,
 {
 	struct inode *inode = mpd->inode;
 	int err;
-	ext4_lblk_t blocks = (i_size_read(inode) + i_blocksize(inode) - 1)
-							>> inode->i_blkbits;
+	ext4_lblk_t blocks = DIV_ROUND_UP(i_size_read(inode), i_blocksize(inode));
 
 	if (ext4_verity_in_progress(inode))
 		blocks = EXT_MAX_BLOCKS;
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2023-03-13  9:25 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-10  6:07 [PATCH] ext4: convert to DIV_ROUND_UP() in mpage_process_page_bufs() Yangtao Li
2023-03-10  6:17 ` Eric Biggers
2023-03-10  6:27   ` Yangtao Li
2023-03-10  6:35     ` Gao Xiang
2023-03-10  6:37       ` Gao Xiang
2023-03-10  6:41     ` Eric Biggers
2023-03-10  6:37   ` Al Viro
2023-03-10  6:43     ` Al Viro
2023-03-10  6:43     ` Eric Biggers
2023-03-10  6:46       ` Al Viro
2023-03-10  6:54         ` Eric Biggers
2023-03-10  7:05           ` Al Viro
2023-03-10  7:12             ` Al Viro
2023-03-10 21:47               ` Eric Biggers
2023-03-10 19:07 ` kernel test robot
2023-03-10 19:38 ` kernel test robot
2023-03-10 23:21 ` Theodore Ts'o
2023-03-13  9:25   ` David Laight

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).