diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2020-06-11 08:01:47 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2020-07-05 16:17:12 +0200 |
commit | 43902e57633f5dd9bc71f1a30d69d7bc0f49dc6b (patch) | |
tree | b0bc5aa5c8e30ee05ccc7aedb50a080351b276c8 | |
parent | 6685d24e295ce97b2708c45a7d31531a057a9fc0 (diff) | |
download | barebox-43902e57633f5dd9bc71f1a30d69d7bc0f49dc6b.tar.gz barebox-43902e57633f5dd9bc71f1a30d69d7bc0f49dc6b.tar.xz |
fs: free inodes we no longer need
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@pengutronix.de>
-rw-r--r-- | fs/fs.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -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) |