Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3421297yba; Tue, 16 Apr 2019 10:58:59 -0700 (PDT) X-Google-Smtp-Source: APXvYqzIfSux0HMevvWpVnUpyI+WKm/FaM4xYXGnXqO32mNiDeMcRfLxEDJ7FB+9voxnWWVgg0yC X-Received: by 2002:a63:1654:: with SMTP id 20mr78850666pgw.166.1555437539201; Tue, 16 Apr 2019 10:58:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555437539; cv=none; d=google.com; s=arc-20160816; b=IE4IW84ZLhKXB8Qx30pFYME9S571qUqHUN19HQr0TAf7tqMKz/O+JrnEC9ODI8WAtG XoBD1KyyAjsfYLP42HBkzDqJw+F0Cs09A5KQtNI+Bceure9dT5S3MaQRsyPlKHLTL5Wn Suvz85xvXFsM5rUK/sUPFjS7YMc9lhTiNMdoHHmr2R7bayKBPDyBjCT3IcGxVAmnf+QN v0Fgm0b55ugkgjbK4NK2MJQgVBoZoc6LDs5Zvs69NmM5ajMxvBDhi7WyVpRdKpFiqZB4 AalnjLaxqueg7q8bfrQP+YXITofaAv9nwn+zPiol+wKF272BArjWVHrKEnmDWETmZLvP 9+qw== 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=s+vUEOJLTerhZr/XtxbVxd9sMCafpdk5HJdxmHNI+RM=; b=tjpnMJTzXJIkuE87Ua92HkQh30Cow7G3DB0ndOBt5EqBZhNJfDYa+izePtWJpJkDDa uqhJL48p+Gr0zhyqA8zfJw0qB0STLwcpFV5xzQNfJxRPK9+KUIo62drVudLB//Mwko6z Xw7lNJct+n6Uip6dP+NMrfk59NybMVN6N4J/8QNZ0G/TtksPn0vtLXiF48QswOfyJbz1 K9JAckI9UYvhTV6JwQRKrwG76cHo70Grs1GubaS4wF91AsycgwDIyOcGW+Ah3a1n2IGe f9yjd9Swk0vLCAIIAmwfH7/flVZWfknlF1xKJUsbp7jY9fKV1F8hyvmgryTrZsOBTWfK mbqA== 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 1si24717818ply.311.2019.04.16.10.58.43; Tue, 16 Apr 2019 10:58:59 -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 S1730519AbfDPR4I (ORCPT + 99 others); Tue, 16 Apr 2019 13:56:08 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:57678 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730337AbfDPRxt (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-0005ZN-FF; 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 49/62] dax: make use of ->free_inode() Date: Tue, 16 Apr 2019 18:53:27 +0100 Message-Id: <20190416175340.21068-49-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 we might want to drop ->destroy_inode() there - it's used only for WARN_ON() now, and AFAICS that could be moved to ->evict_inode() if we had one... Signed-off-by: Al Viro --- drivers/dax/super.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/dax/super.c b/drivers/dax/super.c index 0a339b85133e..bbd57ca0634a 100644 --- a/drivers/dax/super.c +++ b/drivers/dax/super.c @@ -412,11 +412,9 @@ static struct dax_device *to_dax_dev(struct inode *inode) return container_of(inode, struct dax_device, inode); } -static void dax_i_callback(struct rcu_head *head) +static void dax_free_inode(struct inode *inode) { - struct inode *inode = container_of(head, struct inode, i_rcu); struct dax_device *dax_dev = to_dax_dev(inode); - kfree(dax_dev->host); dax_dev->host = NULL; if (inode->i_rdev) @@ -427,16 +425,15 @@ static void dax_i_callback(struct rcu_head *head) static void dax_destroy_inode(struct inode *inode) { struct dax_device *dax_dev = to_dax_dev(inode); - WARN_ONCE(test_bit(DAXDEV_ALIVE, &dax_dev->flags), "kill_dax() must be called before final iput()\n"); - call_rcu(&inode->i_rcu, dax_i_callback); } static const struct super_operations dax_sops = { .statfs = simple_statfs, .alloc_inode = dax_alloc_inode, .destroy_inode = dax_destroy_inode, + .free_inode = dax_free_inode, .drop_inode = generic_delete_inode, }; -- 2.11.0