Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3419044yba; Tue, 16 Apr 2019 10:56:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqzrBbXq5y2pJ13ZfyBrD26y16K5DQfrqjnocHnJE/uiIkWSAL8PmawUvP39OiqLsfX9mque X-Received: by 2002:a63:f448:: with SMTP id p8mr72960596pgk.50.1555437372280; Tue, 16 Apr 2019 10:56:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555437372; cv=none; d=google.com; s=arc-20160816; b=qEWGIrUxHNLvkCWPVFFMM6+WRQrHLEhBAHgf8hu8Vw23quckkk3Cc3DkKPKvsk99dd mFbBwG+Qmlh//hzOHd9qL9gtDA/NBVV63Td5AVtS0JTcE6hPPJio/Z/GaIeGaXrTr6em mey/Gzo4BiXkuJAypqkFHuEjuhXr7kd3cIqHiFLSZTSSDVzmdISWnK3GPb0atVIrnSKe 9sCafPdS8YoJhpjUAJ290DULXfb/X5Yl4niTFoDuuLCJTR+iv8w7QjtpUv8ZH0CMytca 9db+PLifTSRcv8UkKxvK9xj78IgPCO55nYIo42wQW9AE6R0d0gNw29vbp4WhqNIj3/m5 cBRQ== 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=KlGJg3BlzDHZvqKDhp4KrYuXjKUC56G7QS/p7JmNVn4=; b=zRar/gXZ5GVPEwcAMGb6CJgx2uVIZIsE3rKkYBtli0Y//UBDWjBbK+zDwB6FBFekOe 6rJNOKVRqBOTZZLGHi34VEe8AVIeTeVUlw9nlN8+pLU2pnxSqUchOhfPMkyBT9A1HA0Z 5mWJOQEjOIbIz5KAo47Rk3cCc8K5RcgldRLESWTFsIWIX3zHJmVbwC0/0tQL1hz7UTyF GrF/acWoMCoJXpUIm5txmikzXtRaSFDgLy9VivHHYcmiR99hrzVguQGoZqZd5rmJ4i1q DfaOeODvAdoCactiD1x80tt9qFo6GXJZC5dkVLD6uzcgTZlq0d4LB9n66uxFyvpIHrSO 25dw== 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 r8si30487303pls.16.2019.04.16.10.55.55; Tue, 16 Apr 2019 10:56:12 -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 S1730609AbfDPRyz (ORCPT + 99 others); Tue, 16 Apr 2019 13:54:55 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:57714 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728108AbfDPRxu (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-0005aH-Mh; 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 58/62] hugetlb: make use of ->free_inode() Date: Tue, 16 Apr 2019 18:53:36 +0100 Message-Id: <20190416175340.21068-58-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 moving synchronous parts of ->destroy_inode() to ->evict_inode() is not possible here - they are balancing the stuff done in ->alloc_inode(), not the things acquired while using it or sanity checks. Signed-off-by: Al Viro --- fs/hugetlbfs/inode.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c index 9285dd4f4b1c..c74ef4426282 100644 --- a/fs/hugetlbfs/inode.c +++ b/fs/hugetlbfs/inode.c @@ -1051,9 +1051,8 @@ static struct inode *hugetlbfs_alloc_inode(struct super_block *sb) return &p->vfs_inode; } -static void hugetlbfs_i_callback(struct rcu_head *head) +static void hugetlbfs_free_inode(struct inode *inode) { - struct inode *inode = container_of(head, struct inode, i_rcu); kmem_cache_free(hugetlbfs_inode_cachep, HUGETLBFS_I(inode)); } @@ -1061,7 +1060,6 @@ static void hugetlbfs_destroy_inode(struct inode *inode) { hugetlbfs_inc_free_inodes(HUGETLBFS_SB(inode->i_sb)); mpol_free_shared_policy(&HUGETLBFS_I(inode)->policy); - call_rcu(&inode->i_rcu, hugetlbfs_i_callback); } static const struct address_space_operations hugetlbfs_aops = { @@ -1108,6 +1106,7 @@ static const struct inode_operations hugetlbfs_inode_operations = { static const struct super_operations hugetlbfs_ops = { .alloc_inode = hugetlbfs_alloc_inode, + .free_inode = hugetlbfs_free_inode, .destroy_inode = hugetlbfs_destroy_inode, .evict_inode = hugetlbfs_evict_inode, .statfs = hugetlbfs_statfs, -- 2.11.0