From: Jeff Layton <jlayton@kernel.org>
To: chuck.lever@oracle.com
Cc: linux-nfs@vger.kernel.org
Subject: [PATCH 6/6] nfsd: eliminate __nfs4_get_fd
Date: Wed, 18 Jan 2023 12:31:39 -0500 [thread overview]
Message-ID: <20230118173139.71846-7-jlayton@kernel.org> (raw)
In-Reply-To: <20230118173139.71846-1-jlayton@kernel.org>
This is wrapper is pointless, and just obscures what's going on.
Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
fs/nfsd/nfs4state.c | 20 +++++++-------------
1 file changed, 7 insertions(+), 13 deletions(-)
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index 06a95f25c522..e61b878a4b45 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -599,12 +599,6 @@ put_nfs4_file(struct nfs4_file *fi)
}
}
-static struct nfsd_file *
-__nfs4_get_fd(struct nfs4_file *f, int oflag)
-{
- return nfsd_file_get(f->fi_fds[oflag]);
-}
-
static struct nfsd_file *
find_writeable_file_locked(struct nfs4_file *f)
{
@@ -612,9 +606,9 @@ find_writeable_file_locked(struct nfs4_file *f)
lockdep_assert_held(&f->fi_lock);
- ret = __nfs4_get_fd(f, O_WRONLY);
+ ret = nfsd_file_get(f->fi_fds[O_WRONLY]);
if (!ret)
- ret = __nfs4_get_fd(f, O_RDWR);
+ ret = nfsd_file_get(f->fi_fds[O_RDWR]);
return ret;
}
@@ -637,9 +631,9 @@ find_readable_file_locked(struct nfs4_file *f)
lockdep_assert_held(&f->fi_lock);
- ret = __nfs4_get_fd(f, O_RDONLY);
+ ret = nfsd_file_get(f->fi_fds[O_RDONLY]);
if (!ret)
- ret = __nfs4_get_fd(f, O_RDWR);
+ ret = nfsd_file_get(f->fi_fds[O_RDWR]);
return ret;
}
@@ -663,11 +657,11 @@ find_any_file(struct nfs4_file *f)
if (!f)
return NULL;
spin_lock(&f->fi_lock);
- ret = __nfs4_get_fd(f, O_RDWR);
+ ret = nfsd_file_get(f->fi_fds[O_RDWR]);
if (!ret) {
- ret = __nfs4_get_fd(f, O_WRONLY);
+ ret = nfsd_file_get(f->fi_fds[O_WRONLY]);
if (!ret)
- ret = __nfs4_get_fd(f, O_RDONLY);
+ ret = nfsd_file_get(f->fi_fds[O_RDONLY]);
}
spin_unlock(&f->fi_lock);
return ret;
--
2.39.0
prev parent reply other threads:[~2023-01-18 17:32 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-18 17:31 [PATCH 0/6] nfsd: random cleanup and doc work Jeff Layton
2023-01-18 17:31 ` [PATCH 1/6] nfsd: don't take nfsd4_copy ref for OP_OFFLOAD_STATUS Jeff Layton
2023-01-18 17:43 ` Olga Kornievskaia
2023-01-18 17:49 ` Jeff Layton
2023-01-18 18:08 ` Olga Kornievskaia
2023-01-18 18:53 ` Chuck Lever III
2023-01-19 1:46 ` Olga Kornievskaia
2023-01-18 17:31 ` [PATCH 2/6] nfsd: eliminate find_deleg_file_locked Jeff Layton
2023-01-18 17:31 ` [PATCH 3/6] nfsd: simplify the delayed disposal list code Jeff Layton
2023-01-18 19:08 ` Chuck Lever III
2023-01-18 19:42 ` Jeff Layton
2023-01-18 20:44 ` Chuck Lever III
2023-04-14 18:20 ` Chuck Lever III
2023-04-14 19:01 ` Jeff Layton
2023-04-14 19:17 ` Jeff Layton
2023-04-14 20:56 ` Chuck Lever III
2023-01-18 17:31 ` [PATCH 4/6] nfsd: don't take/put an extra reference when putting a file Jeff Layton
2023-01-18 17:31 ` [PATCH 5/6] nfsd: add some kerneldoc comments for stateid preprocessing functions Jeff Layton
2023-01-18 17:31 ` Jeff Layton [this message]
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=20230118173139.71846-7-jlayton@kernel.org \
--to=jlayton@kernel.org \
--cc=chuck.lever@oracle.com \
--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.