linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/4] fs: add i_blocksize_mask()
@ 2023-03-09  9:43 Yangtao Li
  2023-03-09  9:43 ` [PATCH 2/4] erofs: convert to use i_blocksize_mask() Yangtao Li
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Yangtao Li @ 2023-03-09  9:43 UTC (permalink / raw)
  To: xiang, chao, huyue2, jefflexu, tytso, adilger.kernel, rpeterso,
	agruenba, viro, brauner
  Cc: linux-erofs, linux-kernel, linux-ext4, cluster-devel,
	linux-fsdevel, Yangtao Li

Introduce i_blocksize_mask() 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>
---
 include/linux/fs.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/include/linux/fs.h b/include/linux/fs.h
index c85916e9f7db..db335bd9c256 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_blocksize_mask(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 related	[flat|nested] 5+ messages in thread

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

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-09  9:43 [PATCH 1/4] fs: add i_blocksize_mask() Yangtao Li
2023-03-09  9:43 ` [PATCH 2/4] erofs: convert to use i_blocksize_mask() Yangtao Li
2023-03-09  9:43 ` [PATCH 3/4] gfs2: " Yangtao Li
2023-03-09  9:43 ` [PATCH 4/4] ext4: " Yangtao Li
2023-03-09 10:21 ` [PATCH 1/4] fs: add i_blocksize_mask() Andreas Gruenbacher

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).