Skip to contentSkip to conversation

New method - evict_inode()

PATCH In review Al Viro 1 participant 1 message Jun 8, 2010 VFS

lore
Share & tools
lore

Al Viro

author
#0 lore raw

PATCH 3/58 New method - evict_inode()

Hybrid of ->clear_inode() and ->delete_inode(); if present, does all fs work to be done when in-core inode is about to be gone, for whatever reason.

---
 fs/inode.c         |    4 +++-
 include/linux/fs.h |    1 +
 2 files changed, 4 insertions(+), 1 deletions(-)
fs/inode.c +3 -1
index 9f52948..10458bb 100644
@@ -325,7 +325,9 @@ static void evict(struct inode *inode, int delete)
 {
 	const struct super_operations *op = inode->i_sb->s_op;
 
-	if (delete && op->delete_inode) {
+	if (op->evict_inode) {
+		op->evict_inode(inode);
+	} else if (delete && op->delete_inode) {
 		op->delete_inode(inode);
 	} else {
 		if (inode->i_data.nrpages)
include/linux/fs.h +1 -0
index 9e4d848..04add37 100644
@@ -1562,6 +1562,7 @@ struct super_operations {
    	void (*dirty_inode) (struct inode *);
 	int (*write_inode) (struct inode *, struct writeback_control *wbc);
 	void (*drop_inode) (struct inode *);
+	void (*evict_inode) (struct inode *);
 	void (*delete_inode) (struct inode *);
 	void (*put_super) (struct super_block *);
 	void (*write_super) (struct super_block *);
Signature · 1 line
1.5.6.5