summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorJosef Bacik <josef@toxicpanda.com>2025-08-26 18:39:02 +0300
committerChristian Brauner <brauner@kernel.org>2025-09-01 13:41:09 +0300
commit37b27bd5d6217b75d315f28b4399aad0a336f299 (patch)
treee72e871a9c7120da2f8849523eca1cfb31f851ea /include/linux
parent9e70e985bdc2c6fe7a160e4d59ddd7c0a39bc077 (diff)
downloadlinux-37b27bd5d6217b75d315f28b4399aad0a336f299.tar.xz
fs: add an icount_read helper
Instead of doing direct access to ->i_count, add a helper to handle this. This will make it easier to convert i_count to a refcount later. Signed-off-by: Josef Bacik <josef@toxicpanda.com> Link: https://lore.kernel.org/9bc62a84c6b9d6337781203f60837bd98fbc4a96.1756222464.git.josef@toxicpanda.com Signed-off-by: Christian Brauner <brauner@kernel.org>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/fs.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h
index c34554d8c4fe..c4fd010cf5bf 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -2611,6 +2611,11 @@ static inline void mark_inode_dirty_sync(struct inode *inode)
__mark_inode_dirty(inode, I_DIRTY_SYNC);
}
+static inline int icount_read(const struct inode *inode)
+{
+ return atomic_read(&inode->i_count);
+}
+
/*
* Returns true if the given inode itself only has dirty timestamps (its pages
* may still be dirty) and isn't currently being allocated or freed.