[PATCH 04/11] fs: free inodes we no longer need

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



So far we freed the no longer needed inodes only at unmount time.
Let's trust our reference counting a bit more and free them once
the reference counter hits zero.

Signed-off-by: Sascha Hauer <s.hauer@xxxxxxxxxxxxxx>
---
 fs/fs.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/fs/fs.c b/fs/fs.c
index cecb3d70e0..e04cadfe5d 100644
--- a/fs/fs.c
+++ b/fs/fs.c
@@ -1090,10 +1090,12 @@ void iput(struct inode *inode)
 	if (!inode)
 		return;
 
-	if (!inode->i_count)
-		return;
-
 	inode->i_count--;
+
+	if (!inode->i_count) {
+		list_del(&inode->i_sb_list);
+		destroy_inode(inode);
+	}
 }
 
 struct inode *iget(struct inode *inode)
-- 
2.27.0


_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux