Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3419110yba; Tue, 16 Apr 2019 10:56:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqyuVeBI25qki5jdaOM1iW27NUZHo29H/mBc7c2w5DN9gMGGcwd7TvBMC/SeK/VlRBUjtXxY X-Received: by 2002:a65:518d:: with SMTP id h13mr480983pgq.259.1555437378094; Tue, 16 Apr 2019 10:56:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555437378; cv=none; d=google.com; s=arc-20160816; b=Md1zn2dQWA0gdRrJ1PQB5fWHG/LzyxL5S5jldJmKhJ+bQqvVlpR8HxCsEiL3DD3bfQ 2SEEgCaN6BxFVSdoJRQRgJBKa+ApKVfsD10Ka/R+P5rW78fw8IJgQNzlusHawjijIas8 guDMKjFe7HSEhCtt1tCK+Tfnd+ZIZAUCdnRxJHHatT+jMnF9bRtfTj9wNo1iDFX+znzy 84lw6GcWZ+UDl2kBaoFM/9HYx1l1NW37dxHkCeDSikoJZaSOH0IeHQQ91wmQDkPaerNj pQmAMCDpkzZXROjHelnF+0xNgMBlv+1t+QVHZbmRynDx7kLxM3ivz/BUB8lUYmkWXCFe 7jUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=KWBQq2E6IECpdpDndUDReeWDwN7UFcjrtvUkI/Aafxk=; b=ND1Z+eY1LUrSQ5D31fI5bqAGvTRauHBMRlocTWIOJ2gl1XBvc4EGOtcapI9Qjpu7wF WTD+y+dI7uzGb55mjcFSoY/sCCrqNRghgbzek8P72nlfHoi38HhCRYO0Davcyr0a/GmG uWPytGxNdqAKLY6+6nL1ZT9/F2N4Z2Jsw4Bd5KS7n2BpfzKKV49JHJunhvGKnqMO5JSp 9xLPFiOl60DFYmS4QLKgci1dnYeDBcivoyVPd4d8JZJ8AVxCvQcljaWiOHfEquLor7ft E6ZYEXbEly32nCJMYtEwozRKC6DKusgH/taPS+adaMCjz/JUi9ApnHTxm5LgT4nwtmR7 ZJJg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j12si41897044pgb.14.2019.04.16.10.56.01; Tue, 16 Apr 2019 10:56:18 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730638AbfDPRy6 (ORCPT + 99 others); Tue, 16 Apr 2019 13:54:58 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:57706 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730361AbfDPRxu (ORCPT ); Tue, 16 Apr 2019 13:53:50 -0400 Received: from viro by ZenIV.linux.org.uk with local (Exim 4.92 #3 (Red Hat Linux)) id 1hGSHE-0005a5-HX; Tue, 16 Apr 2019 17:53:48 +0000 From: Al Viro To: Linus Torvalds Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: [RFC PATCH 56/62] jfs: switch to ->free_inode() Date: Tue, 16 Apr 2019 18:53:34 +0100 Message-Id: <20190416175340.21068-56-viro@ZenIV.linux.org.uk> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190416175340.21068-1-viro@ZenIV.linux.org.uk> References: <20190416174900.GT2217@ZenIV.linux.org.uk> <20190416175340.21068-1-viro@ZenIV.linux.org.uk> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Al Viro synchronous part can be moved to ->evict_inode(), the rest - ->free_inode() fodder Signed-off-by: Al Viro --- fs/jfs/inode.c | 13 +++++++++++++ fs/jfs/super.c | 24 +++--------------------- 2 files changed, 16 insertions(+), 21 deletions(-) diff --git a/fs/jfs/inode.c b/fs/jfs/inode.c index 805ae9e8944a..f2b92b292abe 100644 --- a/fs/jfs/inode.c +++ b/fs/jfs/inode.c @@ -31,6 +31,7 @@ #include "jfs_extent.h" #include "jfs_unicode.h" #include "jfs_debug.h" +#include "jfs_dmap.h" struct inode *jfs_iget(struct super_block *sb, unsigned long ino) @@ -150,6 +151,8 @@ int jfs_write_inode(struct inode *inode, struct writeback_control *wbc) void jfs_evict_inode(struct inode *inode) { + struct jfs_inode_info *ji = JFS_IP(inode); + jfs_info("In jfs_evict_inode, inode = 0x%p", inode); if (!inode->i_nlink && !is_bad_inode(inode)) { @@ -173,6 +176,16 @@ void jfs_evict_inode(struct inode *inode) } clear_inode(inode); dquot_drop(inode); + + BUG_ON(!list_empty(&ji->anon_inode_list)); + + spin_lock_irq(&ji->ag_lock); + if (ji->active_ag != -1) { + struct bmap *bmap = JFS_SBI(inode->i_sb)->bmap; + atomic_dec(&bmap->db_active[ji->active_ag]); + ji->active_ag = -1; + } + spin_unlock_irq(&ji->ag_lock); } void jfs_dirty_inode(struct inode *inode, int flags) diff --git a/fs/jfs/super.c b/fs/jfs/super.c index 65d8fc87ab11..9454831bbd71 100644 --- a/fs/jfs/super.c +++ b/fs/jfs/super.c @@ -124,27 +124,9 @@ static struct inode *jfs_alloc_inode(struct super_block *sb) return &jfs_inode->vfs_inode; } -static void jfs_i_callback(struct rcu_head *head) +static void jfs_free_inode(struct inode *inode) { - struct inode *inode = container_of(head, struct inode, i_rcu); - struct jfs_inode_info *ji = JFS_IP(inode); - kmem_cache_free(jfs_inode_cachep, ji); -} - -static void jfs_destroy_inode(struct inode *inode) -{ - struct jfs_inode_info *ji = JFS_IP(inode); - - BUG_ON(!list_empty(&ji->anon_inode_list)); - - spin_lock_irq(&ji->ag_lock); - if (ji->active_ag != -1) { - struct bmap *bmap = JFS_SBI(inode->i_sb)->bmap; - atomic_dec(&bmap->db_active[ji->active_ag]); - ji->active_ag = -1; - } - spin_unlock_irq(&ji->ag_lock); - call_rcu(&inode->i_rcu, jfs_i_callback); + kmem_cache_free(jfs_inode_cachep, JFS_IP(inode)); } static int jfs_statfs(struct dentry *dentry, struct kstatfs *buf) @@ -912,7 +894,7 @@ static int jfs_quota_off(struct super_block *sb, int type) static const struct super_operations jfs_super_operations = { .alloc_inode = jfs_alloc_inode, - .destroy_inode = jfs_destroy_inode, + .free_inode = jfs_free_inode, .dirty_inode = jfs_dirty_inode, .write_inode = jfs_write_inode, .evict_inode = jfs_evict_inode, -- 2.11.0