diff options
| author | Mateusz Guzik <mjguzik@gmail.com> | 2025-10-09 09:59:19 +0200 |
|---|---|---|
| committer | Christian Brauner <brauner@kernel.org> | 2025-10-20 20:22:26 +0200 |
| commit | f5aa78e2be066f3801785094f1b55a3114fe461a (patch) | |
| tree | b89d5165a7cf685d469c7c1ed231b6915ff7068e /fs/inode.c | |
| parent | b4dbfd8653b34b0ab6c024ceda32af488c9b5602 (diff) | |
Manual conversion to use ->i_state accessors of all places not covered by coccinelle
Nothing to look at apart from iput_final().
Signed-off-by: Mateusz Guzik <mjguzik@gmail.com>
Signed-off-by: Christian Brauner <brauner@kernel.org>
Diffstat (limited to 'fs/inode.c')
| -rw-r--r-- | fs/inode.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/fs/inode.c b/fs/inode.c index f094ed3e6f30..3153d725859c 100644 --- a/fs/inode.c +++ b/fs/inode.c @@ -829,7 +829,7 @@ static void evict(struct inode *inode) * This also means we don't need any fences for the call below. */ inode_wake_up_bit(inode, __I_NEW); - BUG_ON(inode->i_state != (I_FREEING | I_CLEAR)); + BUG_ON(inode_state_read_once(inode) != (I_FREEING | I_CLEAR)); destroy_inode(inode); } @@ -1883,7 +1883,6 @@ static void iput_final(struct inode *inode) { struct super_block *sb = inode->i_sb; const struct super_operations *op = inode->i_sb->s_op; - unsigned long state; int drop; WARN_ON(inode_state_read(inode) & I_NEW); @@ -1908,20 +1907,19 @@ static void iput_final(struct inode *inode) */ VFS_BUG_ON_INODE(atomic_read(&inode->i_count) != 0, inode); - state = inode_state_read(inode); - if (!drop) { - WRITE_ONCE(inode->i_state, state | I_WILL_FREE); + if (drop) { + inode_state_set(inode, I_FREEING); + } else { + inode_state_set(inode, I_WILL_FREE); spin_unlock(&inode->i_lock); write_inode_now(inode, 1); spin_lock(&inode->i_lock); - state = inode_state_read(inode); - WARN_ON(state & I_NEW); - state &= ~I_WILL_FREE; + WARN_ON(inode_state_read(inode) & I_NEW); + inode_state_replace(inode, I_WILL_FREE, I_FREEING); } - WRITE_ONCE(inode->i_state, state | I_FREEING); if (!list_empty(&inode->i_lru)) inode_lru_list_del(inode); spin_unlock(&inode->i_lock); @@ -2985,7 +2983,7 @@ void dump_inode(struct inode *inode, const char *reason) pr_warn("%s encountered for inode %px\n" "fs %s mode %ho opflags 0x%hx flags 0x%x state 0x%x count %d\n", reason, inode, sb->s_type->name, inode->i_mode, inode->i_opflags, - inode->i_flags, inode->i_state, atomic_read(&inode->i_count)); + inode->i_flags, inode_state_read_once(inode), atomic_read(&inode->i_count)); } EXPORT_SYMBOL(dump_inode); |
