@@ -1528,19 +1528,21 @@ void iput(struct inode *inode)
{
if (!inode)
return;
+
BUG_ON(inode->i_state & I_CLEAR);
retry:
- if (atomic_dec_and_lock(&inode->i_count, &inode->i_lock)) {
- if (inode->i_nlink && (inode->i_state & I_DIRTY_TIME)) {
- atomic_inc(&inode->i_count);
- inode->i_state &= ~I_DIRTY_TIME;
- spin_unlock(&inode->i_lock);
- trace_writeback_lazytime_iput(inode);
- mark_inode_dirty_sync(inode);
- goto retry;
- }
- iput_final(inode);
+ if (!atomic_dec_and_lock(&inode->i_count, &inode->i_lock))
+ return;
+
+ if (inode->i_nlink && (inode->i_state & I_DIRTY_TIME)) {
+ atomic_inc(&inode->i_count);
+ inode->i_state &= ~I_DIRTY_TIME;
+ spin_unlock(&inode->i_lock);
+ trace_writeback_lazytime_iput(inode);
+ mark_inode_dirty_sync(inode);
+ goto retry;
}
+ iput_final(inode);
}
EXPORT_SYMBOL(iput);
Preparatory patch for elimination of iput_final(). No functional change. Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> --- fs/inode.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-)