[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230309094317.69773-1-frank.li@vivo.com>
Date: Thu, 9 Mar 2023 17:43:14 +0800
From: Yangtao Li <frank.li@...o.com>
To: xiang@...nel.org, chao@...nel.org, huyue2@...lpad.com,
jefflexu@...ux.alibaba.com, tytso@....edu,
adilger.kernel@...ger.ca, rpeterso@...hat.com, agruenba@...hat.com,
viro@...iv.linux.org.uk, brauner@...nel.org
Cc: linux-erofs@...ts.ozlabs.org, linux-kernel@...r.kernel.org,
linux-ext4@...r.kernel.org, cluster-devel@...hat.com,
linux-fsdevel@...r.kernel.org, Yangtao Li <frank.li@...o.com>
Subject: [PATCH 1/4] fs: add i_blocksize_mask()
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@...o.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
Powered by blists - more mailing lists