mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v4 1/5] fs: add i_blockmask()
@ 2023-03-10  5:48 Yangtao Li
  2023-03-10  5:48 ` [PATCH v4 2/5] erofs: convert to use i_blockmask() Yangtao Li
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Yangtao Li @ 2023-03-10  5:48 UTC (permalink / raw)
  To: xiang, chao, huyue2, jefflexu, tytso, adilger.kernel, rpeterso,
	agruenba, mark, jlbec, joseph.qi, viro, brauner
  Cc: linux-erofs, linux-kernel, linux-ext4, cluster-devel,
	ocfs2-devel, linux-fsdevel, Yangtao Li

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@vivo.com>
---
v4:
-drop ext4 patch
-erofs patch based on mainline
-a bit change in ocfs2 patch
 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 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -711,6 +711,11 @@ static inline unsigned int i_blocksize(const struct inode *node)
 	return (1 << node->i_blkbits);
 }
 
+static inline unsigned int i_blockmask(const struct inode *node)
+{
+	return i_blocksize(node) - 1;
+}
+
 static inline int inode_unhashed(struct inode *inode)
 {
 	return hlist_unhashed(&inode->i_hash);
-- 
2.25.1


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

end of thread, other threads:[~2023-03-10 11:14 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-10  5:48 [PATCH v4 1/5] fs: add i_blockmask() Yangtao Li
2023-03-10  5:48 ` [PATCH v4 2/5] erofs: convert to use i_blockmask() Yangtao Li
2023-03-10  6:01   ` Gao Xiang
2023-03-10  6:15     ` Yangtao Li
2023-03-10  6:20       ` Gao Xiang
2023-03-10  5:48 ` [PATCH v4 3/5] gfs2: " Yangtao Li
2023-03-10  5:48 ` [PATCH v4 4/5] ocfs2: " Yangtao Li
2023-03-10 11:13   ` Joseph Qi
2023-03-10  5:48 ` [PATCH v4 5/5] fs/remap_range: " Yangtao Li

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®