Received: by 2002:ac0:e34a:0:0:0:0:0 with SMTP id g10csp462376imn; Mon, 25 Jul 2022 23:47:50 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tWouh4CVBUCOSmUBy0kz0jIsx0sJyH/A8g8Cze6CphgoCalEvxKKXA0A07f22L4ja5e4RZ X-Received: by 2002:a05:6402:239a:b0:43b:c72a:fa4d with SMTP id j26-20020a056402239a00b0043bc72afa4dmr16462340eda.389.1658818070050; Mon, 25 Jul 2022 23:47:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658818070; cv=none; d=google.com; s=arc-20160816; b=Xw9K/45E3qfyuCxB0Pk9cRQ+tRnoABpN50rOy4BybSG1DMFAjJi78BdPUQ7oho3EXB Xbk2+wU7naJ9mqmYYiRZfCIMs8uf6613Vsndf2zSiFE+7uyhrAk9AY5/k/LQsLlO0wuP 3gNDfzbNE+hKU2KtBbAFU3pTCpKo914oEYJw7Jp1SmVbuIvdqdyNXf4KyhjhzsWfiNsE mNxWKN8Mn4EtvpO2cDi9wONn585U0lWb5I4h/oATtTdXAxjoRfP2rZ70QVphNQXErLJ6 5unjH58jxqmkF3KwwCaBstenUkeoNQIy8Wp1GEnFet1qooL9u2SwseihAT5d0r5f5kDQ sL4g== 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:dkim-signature:dkim-signature; bh=ePa1x2uD8CtuHpfLxEYr/n7k1l/cebYMz0fEjvXQz40=; b=zaxWc42foevzLOOKuTD7f/Fi9gugtI1KZzR30QffhbQiVzCmofdj9pAP9PLM/6hQxd A5SpSmeK6G077HrgZLgNyFJMgwb6g+fSnhUrpXSIas1frjICABje29FHUzXjpO03q2l1 OA4zNlezw5vWLVGY7Vfwe5p0Oz7UhvZR8pKv1ylhsdoaCb/VZlRiXgqkW0C2IYpcLz5x Lxe8D9vwGfTH6EhIgX5XSzkPiZvwN5LdjhqAo0L5wXqlDBFlhK9XZCszj3bVgIsUiuNr a7PYGUcs7MtTCK5D6wDZHdMGhaQkbepWFOsz2uxiVHbGTJTTKF/dyMtNXJ/02yPBIZ9s LbHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=OYLJrya4; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=Z5E2ld7X; 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=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qb31-20020a1709077e9f00b0072aef01015dsi15396151ejc.532.2022.07.25.23.47.23; Mon, 25 Jul 2022 23:47:50 -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; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=OYLJrya4; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=Z5E2ld7X; 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=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237776AbiGZGqm (ORCPT + 99 others); Tue, 26 Jul 2022 02:46:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59032 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237863AbiGZGqm (ORCPT ); Tue, 26 Jul 2022 02:46:42 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 18FFA20BD6 for ; Mon, 25 Jul 2022 23:46:41 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id C6CEA34595; Tue, 26 Jul 2022 06:46:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1658817999; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ePa1x2uD8CtuHpfLxEYr/n7k1l/cebYMz0fEjvXQz40=; b=OYLJrya4pcSi+L32rmSMbFsr5awCIIvA8oVwVUBKqWeCDQz4W1v3EPnGh9Av6QrCnXV4MI e8a1lFDAh49cSB56/Ojg4wI07jUEV7aBG+dAUUQMDfa23FaHOH0GamkLRP4u04ZF7FD8g3 PminR6XWdtX1BQDTFKfSYzIhbL70/uM= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1658817999; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ePa1x2uD8CtuHpfLxEYr/n7k1l/cebYMz0fEjvXQz40=; b=Z5E2ld7X7l4Y4FlqX7pt0v3hTPPUqdN/mMQBtEf/l6KwtT0KYrlTm5IrYVqaal3hKBA97W Xr81zEyK2SWTEMBg== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id A888713A7C; Tue, 26 Jul 2022 06:46:38 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 1C0DGc6N32I3WAAAMHmgww (envelope-from ); Tue, 26 Jul 2022 06:46:38 +0000 Subject: [PATCH 01/13] NFSD: drop fh argument from alloc_init_deleg From: NeilBrown To: Chuck Lever III , Jeff Layton Cc: Linux NFS Mailing List Date: Tue, 26 Jul 2022 16:45:30 +1000 Message-ID: <165881793053.21666.13673223627958617026.stgit@noble.brown> In-Reply-To: <165881740958.21666.5904057696047278505.stgit@noble.brown> References: <165881740958.21666.5904057696047278505.stgit@noble.brown> User-Agent: StGit/1.5 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS 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 From: Jeff Layton Currently, we pass the fh of the opened file down through several functions so that alloc_init_deleg can pass it to delegation_blocked. The filehandle of the open file is available in the nfs4_file however, so there's no need to pass it in a separate argument. Drop the argument from alloc_init_deleg, nfs4_open_delegation and nfs4_set_delegation. Signed-off-by: Jeff Layton --- fs/nfsd/nfs4state.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index e46e3392d557..279c7a1502c9 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c @@ -1131,7 +1131,6 @@ static void block_delegations(struct knfsd_fh *fh) static struct nfs4_delegation * alloc_init_deleg(struct nfs4_client *clp, struct nfs4_file *fp, - struct svc_fh *current_fh, struct nfs4_clnt_odstate *odstate) { struct nfs4_delegation *dp; @@ -1141,7 +1140,7 @@ alloc_init_deleg(struct nfs4_client *clp, struct nfs4_file *fp, n = atomic_long_inc_return(&num_delegations); if (n < 0 || n > max_delegations) goto out_dec; - if (delegation_blocked(¤t_fh->fh_handle)) + if (delegation_blocked(&fp->fi_fhandle)) goto out_dec; dp = delegstateid(nfs4_alloc_stid(clp, deleg_slab, nfs4_free_deleg)); if (dp == NULL) @@ -5290,7 +5289,7 @@ static int nfsd4_check_conflicting_opens(struct nfs4_client *clp, } static struct nfs4_delegation * -nfs4_set_delegation(struct nfs4_client *clp, struct svc_fh *fh, +nfs4_set_delegation(struct nfs4_client *clp, struct nfs4_file *fp, struct nfs4_clnt_odstate *odstate) { int status = 0; @@ -5335,7 +5334,7 @@ nfs4_set_delegation(struct nfs4_client *clp, struct svc_fh *fh, return ERR_PTR(status); status = -ENOMEM; - dp = alloc_init_deleg(clp, fp, fh, odstate); + dp = alloc_init_deleg(clp, fp, odstate); if (!dp) goto out_delegees; @@ -5403,8 +5402,7 @@ static void nfsd4_open_deleg_none_ext(struct nfsd4_open *open, int status) * proper support for them. */ static void -nfs4_open_delegation(struct svc_fh *fh, struct nfsd4_open *open, - struct nfs4_ol_stateid *stp) +nfs4_open_delegation(struct nfsd4_open *open, struct nfs4_ol_stateid *stp) { struct nfs4_delegation *dp; struct nfs4_openowner *oo = openowner(stp->st_stateowner); @@ -5436,7 +5434,7 @@ nfs4_open_delegation(struct svc_fh *fh, struct nfsd4_open *open, default: goto out_no_deleg; } - dp = nfs4_set_delegation(clp, fh, stp->st_stid.sc_file, stp->st_clnt_odstate); + dp = nfs4_set_delegation(clp, stp->st_stid.sc_file, stp->st_clnt_odstate); if (IS_ERR(dp)) goto out_no_deleg; @@ -5568,7 +5566,7 @@ nfsd4_process_open2(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nf * Attempt to hand out a delegation. No error return, because the * OPEN succeeds even if we fail. */ - nfs4_open_delegation(current_fh, open, stp); + nfs4_open_delegation(open, stp); nodeleg: status = nfs_ok; trace_nfsd_open(&stp->st_stid.sc_stateid);