New method - evict_inode()
authorAl Viro <viro@zeniv.linux.org.uk>
Fri, 4 Jun 2010 23:40:39 +0000 (19:40 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Mon, 9 Aug 2010 20:47:46 +0000 (16:47 -0400)
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.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/inode.c
include/linux/fs.h

index 60cb259..474a72f 100644 (file)
@@ -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)
index 218693d..ce50be4 100644 (file)
@@ -1563,6 +1563,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 *);