Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp4863509iog; Wed, 22 Jun 2022 07:16:30 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vskinTXKOwzIMitRYgjee5da8Fb/41D/6dkygXsY9AXQI1l9ebr7A0urDsX0jQ1IrNBoUE X-Received: by 2002:a17:903:2445:b0:16a:32da:cc9 with SMTP id l5-20020a170903244500b0016a32da0cc9mr10949702pls.148.1655907390251; Wed, 22 Jun 2022 07:16:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655907390; cv=none; d=google.com; s=arc-20160816; b=d1wN0GLyIoUUrwWy9uu+ARUhUEG14R0NKKSIpvCQQijw+xr4cUaSAv6QQfHTSmYQuy X98tJk2g6XXmPsW8ss+TqMD1DzfDzjxQoM8dBbfgsURrNdwmM6aPy3wjrt8C4SwIxB+X bVumaF6jzrzXbrkvJJkj7sVWMswYvtonFFprQaNtIsZud6KHciNd9peGxpRPha5hZX8F re2oJlNbk+lS9Wc9IInS/jX6QDRGFA7MK7PJPFHStxl54dg8dNZkS/O3etQvwzf1q36Q Ycj4MMIJTdMEFziAcnSSdtLgp3aswL1EO9llI6bH8O7up/NwRnbvKqDKYk7O1H5bul0L YmoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:cc:to:from :subject; bh=XHYJhrHPUWiZm82nR+QMAWFc4ZL7K8vLwQ4w8NmYdXc=; b=CgA61XsfXCvhjPWl7GdRv2qOFfoUm0dOjr/cwezEHxoKZIeiMVKklB0pkHlhzIZuWk rGAUJhszlxyDZxVAQvztOJo3JzDohxNuXsEgm/mqfcgEEbRp0hTkRm7pcwXMc2FjxygG o4dUY5zYpnlvhW791AQ+Z4h9ntr7rePqK+qkK+SGfHngqkqeqjv5K7FDojjfEVlYCMtU wkC+/uE1XVbgPdKWrHcAPAwbAU8Nvzr6AlG7z+tKlIwynNaFlxvyFzZHNqeIBzkSoVHL nUUOu/GB198d82kXAQ1CQ7RYexfojixmmB/nrzxv6Lq95k/h9+bX6BmznRha9cpOB8n/ d11A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p2-20020a170903248200b0015a39e94e61si20676955plw.420.2022.06.22.07.16.17; Wed, 22 Jun 2022 07:16:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1358271AbiFVOQA (ORCPT + 99 others); Wed, 22 Jun 2022 10:16:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36360 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1358426AbiFVOPW (ORCPT ); Wed, 22 Jun 2022 10:15:22 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DB94F640A; Wed, 22 Jun 2022 07:15:01 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 80E25B81F56; Wed, 22 Jun 2022 14:15:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EC08EC34114; Wed, 22 Jun 2022 14:14:58 +0000 (UTC) Subject: [PATCH RFC 20/30] NFSD: nfsd_file_unhash can compute hashval from nf->nf_inode From: Chuck Lever To: linux-nfs@vger.kernel.org, netdev@vger.kernel.org Cc: david@fromorbit.com, tgraf@suug.ch, jlayton@redhat.com Date: Wed, 22 Jun 2022 10:14:58 -0400 Message-ID: <165590729799.75778.13928806931358117096.stgit@manet.1015granger.net> In-Reply-To: <165590626293.75778.9843437418112335153.stgit@manet.1015granger.net> References: <165590626293.75778.9843437418112335153.stgit@manet.1015granger.net> User-Agent: StGit/1.5.dev2+g9ce680a5 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org Remove an unnecessary usage of nf_hashval. Signed-off-by: Chuck Lever --- fs/nfsd/filecache.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/fs/nfsd/filecache.c b/fs/nfsd/filecache.c index 304faa28afd7..16679a80f20e 100644 --- a/fs/nfsd/filecache.c +++ b/fs/nfsd/filecache.c @@ -280,13 +280,17 @@ static void nfsd_file_lru_remove(struct nfsd_file *nf) static void nfsd_file_do_unhash(struct nfsd_file *nf) { - lockdep_assert_held(&nfsd_file_hashtbl[nf->nf_hashval].nfb_lock); + struct inode *inode = nf->nf_inode; + unsigned int hashval = (unsigned int)hash_long(inode->i_ino, + NFSD_FILE_HASH_BITS); + + lockdep_assert_held(&nfsd_file_hashtbl[hashval].nfb_lock); trace_nfsd_file_unhash(nf); if (nfsd_file_check_write_error(nf)) nfsd_reset_write_verifier(net_generic(nf->nf_net, nfsd_net_id)); - --nfsd_file_hashtbl[nf->nf_hashval].nfb_count; + --nfsd_file_hashtbl[hashval].nfb_count; hlist_del_rcu(&nf->nf_node); atomic_long_dec(&nfsd_filecache_count); }