From mboxrd@z Thu Jan 1 00:00:00 1970 From: Al Viro Subject: [PATCH 43/58] switch ocfs2 to ->evict_inode() Date: Tue, 08 Jun 2010 23:22:03 +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]:42274 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932211Ab0FHWWE (ORCPT ); Tue, 8 Jun 2010 18:22:04 -0400 Received: from viro by ZenIV.linux.org.uk with local (Exim 4.69 #1 (Red Hat Linux)) id 1OM7BL-0004eS-D4 for linux-fsdevel@vger.kernel.org; Tue, 08 Jun 2010 22:22:03 +0000 Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Signed-off-by: Al Viro --- fs/ocfs2/inode.c | 23 ++++++++--------------- fs/ocfs2/inode.h | 3 +-- fs/ocfs2/super.c | 3 +-- 3 files changed, 10 insertions(+), 19 deletions(-) diff --git a/fs/ocfs2/inode.c b/fs/ocfs2/inode.c index abb0a95..29343c9 100644 --- a/fs/ocfs2/inode.c +++ b/fs/ocfs2/inode.c @@ -969,14 +969,20 @@ static void ocfs2_cleanup_delete_inode(struct inode *inode, truncate_inode_pages(&inode->i_data, 0); } -void ocfs2_delete_inode(struct inode *inode) +void ocfs2_evict_inode(struct inode *inode) { int wipe, status; sigset_t oldset; struct buffer_head *di_bh = NULL; + struct ocfs2_inode_info *oi = OCFS2_I(inode); mlog_entry("(inode->i_ino = %lu)\n", inode->i_ino); + if (inode->i_nlink) { + truncate_inode_pages(&inode->i_data, 0); + goto bail; + } + /* When we fail in read_inode() we mark inode as bad. The second test * catches the case when inode allocation fails before allocating * a block for inode. */ @@ -1075,19 +1081,7 @@ bail_unlock_nfs_sync: bail_unblock: ocfs2_unblock_signals(&oldset); bail: - clear_inode(inode); - mlog_exit_void(); -} - -void ocfs2_clear_inode(struct inode *inode) -{ - int status; - struct ocfs2_inode_info *oi = OCFS2_I(inode); - - mlog_entry_void(); - - if (!inode) - goto bail; + end_writeback(inode); mlog(0, "Clearing inode: %llu, nlink = %u\n", (unsigned long long)OCFS2_I(inode)->ip_blkno, inode->i_nlink); @@ -1180,7 +1174,6 @@ void ocfs2_clear_inode(struct inode *inode) jbd2_journal_release_jbd_inode(OCFS2_SB(inode->i_sb)->journal->j_journal, &oi->ip_jinode); -bail: mlog_exit_void(); } diff --git a/fs/ocfs2/inode.h b/fs/ocfs2/inode.h index 9f5f5fc..975eedd 100644 --- a/fs/ocfs2/inode.h +++ b/fs/ocfs2/inode.h @@ -123,8 +123,7 @@ static inline struct ocfs2_caching_info *INODE_CACHE(struct inode *inode) return &OCFS2_I(inode)->ip_metadata_cache; } -void ocfs2_clear_inode(struct inode *inode); -void ocfs2_delete_inode(struct inode *inode); +void ocfs2_evict_inode(struct inode *inode); void ocfs2_drop_inode(struct inode *inode); /* Flags for ocfs2_iget() */ diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c index 0eaa929..ae1a443 100644 --- a/fs/ocfs2/super.c +++ b/fs/ocfs2/super.c @@ -145,8 +145,7 @@ static const struct super_operations ocfs2_sops = { .alloc_inode = ocfs2_alloc_inode, .destroy_inode = ocfs2_destroy_inode, .drop_inode = ocfs2_drop_inode, - .clear_inode = ocfs2_clear_inode, - .delete_inode = ocfs2_delete_inode, + .evict_inode = ocfs2_evict_inode, .sync_fs = ocfs2_sync_fs, .put_super = ocfs2_put_super, .remount_fs = ocfs2_remount, -- 1.5.6.5