Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3419915yba; Tue, 16 Apr 2019 10:57:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqykNR3q+fz0dk94rnOhwRWKJ0UayDGQsBo1yaTobwPLIjikHtjKQeJuRyNFYNLlJmmzB/SM X-Received: by 2002:aa7:8092:: with SMTP id v18mr82246607pff.35.1555437439440; Tue, 16 Apr 2019 10:57:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555437439; cv=none; d=google.com; s=arc-20160816; b=V7G+aLe1p+4uDCi+RCpy8hL1NiFm6wxjvgGPW8bMUgvjX3PSE2mbJCy6Q09nDUmJKX AcssEIWrw6mrJHaGqjlKG/BBYus0yeBuIXarf5tvvTreDkmaaDR9MriplK+34MGLd5C2 CDjx+deZTBoGhzdiec3T7ogn0nwqj0K6ncZYq/c8yxYBXgeONAz/zLgbshVoWmLrclcS SFWHNBc5mL0mMfdcAtN10N/qeBQUETMpuYMyokBi+daVSGrQt3l2VzqPAmeQ4Q8hnPse otxauHjxCOgMIZjhNN4nHrKWb+nWA56vnoep+P8tCuIxZt/x5yB+SQMxmsd+xJB5ma9Y rlFQ== 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=C6Q1v+MYMAoU1YId4Pg2Qyz4YEduuREQSAESBWyDLSg=; b=N7yKnwMyAMBljlg7VgCh0233zoaXwYvEKzBAW2yzl6Ypp2qEshLIPolZY3sPUCyVOe Sg9fRXy98bxH82sZ5hVtvh1EadIOafQNGr/rTOg8acTCKaCMA8mWaUfofyoGxxlJ2XC4 y5B0mNMOJqJVJGsOneYLov60aDxH9cOuk/Y5qCGRzU0gltovb8d8kvJ0WLaYc5qmTem0 VSzxxx6nFzIH2zNpkVKOa1jFlfF3fR+nOY5LYCUm9hp96IX/dZ09eVJMeej6FZaxyQBy f3Xvp5Dey27oq396GrMNdmqgXDJyFC08ORRD5r/7c1Q+ZMsZtdZy/LLry1+JJfigvEFN 73IQ== 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 r4si48890269pgh.171.2019.04.16.10.57.03; Tue, 16 Apr 2019 10:57:19 -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 S1730684AbfDPRzv (ORCPT + 99 others); Tue, 16 Apr 2019 13:55:51 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:57686 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728468AbfDPRxt (ORCPT ); Tue, 16 Apr 2019 13:53:49 -0400 Received: from viro by ZenIV.linux.org.uk with local (Exim 4.92 #3 (Red Hat Linux)) id 1hGSHD-0005Za-NF; Tue, 16 Apr 2019 17:53:47 +0000 From: Al Viro To: Linus Torvalds Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: [RFC PATCH 51/62] btrfs: use ->free_inode() Date: Tue, 16 Apr 2019 18:53:29 +0100 Message-Id: <20190416175340.21068-51-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 a lot of stuff remains in ->destroy_inode() Signed-off-by: Al Viro --- fs/btrfs/ctree.h | 1 + fs/btrfs/inode.c | 7 ++----- fs/btrfs/super.c | 1 + 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h index b3642367a595..5260a9263d73 100644 --- a/fs/btrfs/ctree.h +++ b/fs/btrfs/ctree.h @@ -3267,6 +3267,7 @@ void btrfs_evict_inode(struct inode *inode); int btrfs_write_inode(struct inode *inode, struct writeback_control *wbc); struct inode *btrfs_alloc_inode(struct super_block *sb); void btrfs_destroy_inode(struct inode *inode); +void btrfs_free_inode(struct inode *inode); int btrfs_drop_inode(struct inode *inode); int __init btrfs_init_cachep(void); void __cold btrfs_destroy_cachep(void); diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 82fdda8ff5ab..aeb31c2dc14e 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -9206,9 +9206,8 @@ void btrfs_test_destroy_inode(struct inode *inode) } #endif -static void btrfs_i_callback(struct rcu_head *head) +void btrfs_free_inode(struct inode *inode) { - struct inode *inode = container_of(head, struct inode, i_rcu); kmem_cache_free(btrfs_inode_cachep, BTRFS_I(inode)); } @@ -9234,7 +9233,7 @@ void btrfs_destroy_inode(struct inode *inode) * created. */ if (!root) - goto free; + return; while (1) { ordered = btrfs_lookup_first_ordered_extent(inode, (u64)-1); @@ -9252,8 +9251,6 @@ void btrfs_destroy_inode(struct inode *inode) btrfs_qgroup_check_reserved_leak(inode); inode_tree_del(inode); btrfs_drop_extent_cache(BTRFS_I(inode), 0, (u64)-1, 0); -free: - call_rcu(&inode->i_rcu, btrfs_i_callback); } int btrfs_drop_inode(struct inode *inode) diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c index 120e4340792a..236f812091a3 100644 --- a/fs/btrfs/super.c +++ b/fs/btrfs/super.c @@ -2298,6 +2298,7 @@ static const struct super_operations btrfs_super_ops = { .show_devname = btrfs_show_devname, .alloc_inode = btrfs_alloc_inode, .destroy_inode = btrfs_destroy_inode, + .free_inode = btrfs_free_inode, .statfs = btrfs_statfs, .remount_fs = btrfs_remount, .freeze_fs = btrfs_freeze, -- 2.11.0