All of lore.kernel.org
 help / color / mirror / Atom feed
From: NeilBrown <neilb@suse.de>
To: Chuck Lever III <chuck.lever@oracle.com>,
	Jeff Layton <jlayton@kernel.org>
Cc: Linux NFS Mailing List <linux-nfs@vger.kernel.org>
Subject: [PATCH 01/13] NFSD: drop fh argument from alloc_init_deleg
Date: Tue, 26 Jul 2022 16:45:30 +1000	[thread overview]
Message-ID: <165881793053.21666.13673223627958617026.stgit@noble.brown> (raw)
In-Reply-To: <165881740958.21666.5904057696047278505.stgit@noble.brown>

From: Jeff Layton <jlayton@kernel.org>

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 <jlayton@kernel.org>
---
 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(&current_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);



  parent reply	other threads:[~2022-07-26  6:46 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-26  6:45 [PATCH 00/13] NFSD: clean up locking NeilBrown
2022-07-26  6:45 ` [PATCH 13/13] NFSD: discard fh_locked flag and fh_lock/fh_unlock NeilBrown
2022-07-26  6:45 ` NeilBrown [this message]
2022-07-26  6:45 ` [PATCH 12/13] NFSD: use (un)lock_inode instead of fh_(un)lock for file operations NeilBrown
2022-07-28 14:55   ` Chuck Lever III
2022-07-26  6:45 ` [PATCH 04/13] NFSD: set attributes when creating symlinks NeilBrown
2022-07-26 12:40   ` Chuck Lever III
2022-07-26 12:53     ` Jeff Layton
2022-07-26 13:02       ` Chuck Lever III
2022-07-26 22:01     ` NeilBrown
2022-07-28 14:53   ` Chuck Lever III
2022-07-29  1:09     ` NeilBrown
2022-07-26  6:45 ` [PATCH 11/13] NFSD: use explicit lock/unlock for directory ops NeilBrown
2022-07-28 14:54   ` Chuck Lever III
2022-07-29  1:27     ` NeilBrown
2022-07-29 14:31       ` Chuck Lever III
2022-07-29 14:34         ` Chuck Lever III
2022-07-26  6:45 ` [PATCH 02/13] NFSD: verify the opened dentry after setting a delegation NeilBrown
2022-07-27 15:44   ` Jeff Layton
2022-07-26  6:45 ` [PATCH 09/13] NFSD: only call fh_unlock() once in nfsd_link() NeilBrown
2022-07-26  6:45 ` [PATCH 06/13] NFSD: add posix ACLs to struct nfsd_attrs NeilBrown
2022-07-29 14:24   ` Chuck Lever III
2022-08-01  0:13     ` NeilBrown
2022-07-26  6:45 ` [PATCH 10/13] NFSD: reduce locking in nfsd_lookup() NeilBrown
2022-07-28 14:54   ` Chuck Lever III
2022-07-26  6:45 ` [PATCH 03/13] NFSD: introduce struct nfsd_attrs NeilBrown
2022-07-28 14:53   ` Chuck Lever III
2022-07-26  6:45 ` [PATCH 05/13] NFSD: add security label to " NeilBrown
2022-07-28 14:54   ` Chuck Lever III
2022-07-29  1:11     ` NeilBrown
2022-07-26  6:45 ` [PATCH 07/13] NFSD: change nfsd_create()/nfsd_symlink() to unlock directory before returning NeilBrown
2022-07-26  6:45 ` [PATCH 08/13] NFSD: always drop directory lock in nfsd_unlink() NeilBrown
2022-07-27 15:50 ` [PATCH 00/13] NFSD: clean up locking Jeff Layton
2022-07-27 17:12   ` Chuck Lever III
2022-07-27 23:48   ` NeilBrown
2022-07-28 14:52 ` Chuck Lever III
2022-07-29  1:29   ` NeilBrown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=165881793053.21666.13673223627958617026.stgit@noble.brown \
    --to=neilb@suse.de \
    --cc=chuck.lever@oracle.com \
    --cc=jlayton@kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.