Skip to contentSkip to conversation

fs: Use common code in inode_lru_isolate()

PATCH New Markus Elfring 1 participant 1 message Oct 10

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fs: Use common code in inode_lru_isolate()

From: Markus Elfring <[email protected]>
Date: Sat, 10 Oct 2026 18:33:37 +0200

Use an additional label so that a few statements can be better reused at the end of this function implementation.

---
 fs/inode.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
fs/inode.c +2 -3
index 702f2d5ef459..3cac85bf5ec3 100644
@@ -953,9 +953,7 @@ static enum lru_status inode_lru_isolate(struct list_head *item,
 	    (inode_state_read(inode) & ~I_REFERENCED) ||
 	    !mapping_shrinkable(&inode->i_data)) {
 		list_lru_isolate(lru, &inode->i_lru);
-		spin_unlock(&inode->i_lock);
-		this_cpu_dec(nr_unused);
-		return LRU_REMOVED;
+		goto unlock;
 	}
 
 	/* Recently referenced inodes get one more pass */
@@ -989,6 +987,7 @@ static enum lru_status inode_lru_isolate(struct list_head *item,
 	WARN_ON(inode_state_read(inode) & I_NEW);
 	inode_state_set(inode, I_FREEING);
 	list_lru_isolate_move(lru, &inode->i_lru, freeable);
+unlock:
 	spin_unlock(&inode->i_lock);
 
 	this_cpu_dec(nr_unused);
Signature · 1 line
2.56.0