mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] fs: Use common code in inode_lru_isolate()
@ 2026-10-10 16:48 Markus Elfring
  0 siblings, 0 replies; only message in thread
From: Markus Elfring @ 2026-10-10 16:48 UTC (permalink / raw)
  To: linux-fsdevel, Alexander Viro, Christian Brauner, Jan Kara
  Cc: LKML, kernel-janitors, Andrew Morton, Dave Chinner,
	Glauber Costa, Nikolaos Karaolidis

From: Markus Elfring <elfring@users.sourceforge.net>
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.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 fs/inode.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/fs/inode.c b/fs/inode.c
index 702f2d5ef459..3cac85bf5ec3 100644
--- a/fs/inode.c
+++ b/fs/inode.c
@@ -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);
-- 
2.56.0


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-10-10 16:48 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-10 16:48 [PATCH] fs: Use common code in inode_lru_isolate() Markus Elfring

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®