From: Al Viro Subject: [PATCH 3/58] New method - evict_inode() Date: Tue, 08 Jun 2010 23:15:22 +0100 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: linux-fsdevel@vger.kernel.org Return-path: Received: from zeniv.linux.org.uk ([195.92.253.2]:38813 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932221Ab0FHWPX (ORCPT ); Tue, 8 Jun 2010 18:15:23 -0400 Received: from viro by ZenIV.linux.org.uk with local (Exim 4.69 #1 (Red Hat Linux)) id 1OM74s-0004XO-Uv for linux-fsdevel@vger.kernel.org; Tue, 08 Jun 2010 22:15:22 +0000 Sender: linux-fsdevel-owner@vger.kernel.org List-ID: 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 --- fs/inode.c | 4 +++- include/linux/fs.h | 1 + 2 files changed, 4 insertions(+), 1 deletions(-) diff --git a/fs/inode.c b/fs/inode.c index 9f52948..10458bb 100644 --- a/fs/inode.c +++ b/fs/inode.c @@ -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) diff --git a/include/linux/fs.h b/include/linux/fs.h index 9e4d848..04add37 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -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 *); -- 1.5.6.5