Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3424167yba; Tue, 16 Apr 2019 11:02:00 -0700 (PDT) X-Google-Smtp-Source: APXvYqwkuvlZ/0h5qfzlLrh5WFap5LIYWLbRkhBrcrPu0rGTMExW2aYgWwU14RT9e6SAZpW3YWWZ X-Received: by 2002:a17:902:b713:: with SMTP id d19mr84476820pls.54.1555437720616; Tue, 16 Apr 2019 11:02:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555437720; cv=none; d=google.com; s=arc-20160816; b=IzezGgBy5VwAxH0tn80ftyczljT979hEG7g9uOG+pOYuep4s99xtmZO81p6uTg1XIx t6JblwAisENVV1g7e59ir3nYZk551Zjer6b48Nn+zPTCUjVdG0mOZMmd7kZtcPY0KPRI 9hykprBUp6JtUMquegrh8Gdn668Nl+3nzhy9olkPEI0aTz5KCIEHpSJMcRv0R6rE4oqG dK75kwZ7iRxEX99AFl9gfZrBZZa1IoxEX0tP7lIhe44WUqNuFLzT4LyPfZO2UXzQe9kk xLu8mSavuGYxggYmtggMQjuXSLgko+GPqJk0ba4IR6drnC+aCgbH9ettzUxNzjZFmWTN p8eg== 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=VRJya3uZZi8+JRVOxwRBvYzi/XgjUSVt5c9l238z3as=; b=Gy3GVWPZlGDnVfm9ZPpouw316rc5hGA+T2L2UvS2afLhJh31OLBn1/6EP2rO3hCjyi 3eEFFLwJd/wXxa3UHJGe0UJdTDoeefzInhtRpZaFmR0GdYMDCNJ4Ev3IJoM2Fsdj6UHL rkyOzDdLw7CNSBENMYMcxVwrzQjOvi2ieRd6E3G4zpPx2l6u2lsk4rxYBuNT1Q8wCrvi VLOLY+CZ96czx7AsQmjE16SivG7YpS5HWEFwteCGI5C0jnj1xUhuDnAcuvInaltTZ+e5 8kvsqmhDNxVGi9/ED6mHbHm8uxrfyrVOWlQqIk6iyBX+Ow1Ca9olqaBhTJvCZqfvfjhb wcAA== 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 33si50399554plk.421.2019.04.16.11.01.39; Tue, 16 Apr 2019 11:02:00 -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 S1730805AbfDPR7l (ORCPT + 99 others); Tue, 16 Apr 2019 13:59:41 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:57556 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730236AbfDPRxo (ORCPT ); Tue, 16 Apr 2019 13:53:44 -0400 Received: from viro by ZenIV.linux.org.uk with local (Exim 4.92 #3 (Red Hat Linux)) id 1hGSH8-0005WB-Ub; Tue, 16 Apr 2019 17:53:43 +0000 From: Al Viro To: Linus Torvalds Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: [RFC PATCH 19/62] gfs2: switch to ->free_inode() Date: Tue, 16 Apr 2019 18:52:57 +0100 Message-Id: <20190416175340.21068-19-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 ... and use GFS2_I() to get the containing gfs2_inode by inode; yes, we can feed the address of the first member of structure to kmem_cache_free(), but let's do it in an obviously safe way. Signed-off-by: Al Viro --- fs/gfs2/super.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/fs/gfs2/super.c b/fs/gfs2/super.c index ca71163ff7cf..7b8d2306b3d3 100644 --- a/fs/gfs2/super.c +++ b/fs/gfs2/super.c @@ -1736,20 +1736,14 @@ static struct inode *gfs2_alloc_inode(struct super_block *sb) return &ip->i_inode; } -static void gfs2_i_callback(struct rcu_head *head) +static void gfs2_free_inode(struct inode *inode) { - struct inode *inode = container_of(head, struct inode, i_rcu); - kmem_cache_free(gfs2_inode_cachep, inode); -} - -static void gfs2_destroy_inode(struct inode *inode) -{ - call_rcu(&inode->i_rcu, gfs2_i_callback); + kmem_cache_free(gfs2_inode_cachep, GFS2_I(inode)); } const struct super_operations gfs2_super_ops = { .alloc_inode = gfs2_alloc_inode, - .destroy_inode = gfs2_destroy_inode, + .free_inode = gfs2_free_inode, .write_inode = gfs2_write_inode, .dirty_inode = gfs2_dirty_inode, .evict_inode = gfs2_evict_inode, -- 2.11.0