From: Benjamin Coddington <bcodding@redhat.com>
To: trond.myklebust@hammerspace.com, anna.schumaker@netapp.com
Cc: linux-nfs@vger.kernel.org
Subject: [PATCH 3/3] NFSv4: cleanup unused zero_stateid copy
Date: Mon, 21 Sep 2020 07:04:41 -0400 [thread overview]
Message-ID: <469888e8990e53fefbff77d71b6e814237333dc8.1600686204.git.bcodding@redhat.com> (raw)
In-Reply-To: <5a7f6bbf4cf2038634a572f42ad80e95a8d0ae9c.1600686204.git.bcodding@redhat.com>
Since commit d9aba2b40de6 ("NFSv4: Don't use the zero stateid with
layoutget") the zero stateid will never be used.
Signed-off-by: Benjamin Coddington <bcodding@redhat.com>
---
fs/nfs/nfs4state.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c
index a8dc25ce48bb..fe2d11ce3fa4 100644
--- a/fs/nfs/nfs4state.c
+++ b/fs/nfs/nfs4state.c
@@ -1018,18 +1018,14 @@ static int nfs4_copy_lock_stateid(nfs4_stateid *dst,
bool nfs4_copy_open_stateid(nfs4_stateid *dst, struct nfs4_state *state)
{
bool ret;
- const nfs4_stateid *src;
int seq;
do {
ret = false;
- src = &zero_stateid;
seq = read_seqbegin(&state->seqlock);
- if (test_bit(NFS_OPEN_STATE, &state->flags)) {
- src = &state->open_stateid;
+ if (test_bit(NFS_OPEN_STATE, &state->flags))
ret = true;
- }
- nfs4_stateid_copy(dst, src);
+ nfs4_stateid_copy(dst, &state->open_stateid);
} while (read_seqretry(&state->seqlock, seq));
return ret;
}
--
2.20.1
next prev parent reply other threads:[~2020-09-21 11:04 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-21 11:04 [PATCH 1/3] NFSv4: Fix a livelock when CLOSE pre-emptively bumps state sequence Benjamin Coddington
2020-09-21 11:04 ` [PATCH 2/3] NFSv4: Refactor nfs_need_update_open_stateid() Benjamin Coddington
2020-09-21 11:17 ` Benjamin Coddington
2020-09-22 10:14 ` [PATCH 2/3 v2] " Benjamin Coddington
2020-09-21 11:04 ` Benjamin Coddington [this message]
2020-09-22 14:03 ` [PATCH 1/3] NFSv4: Fix a livelock when CLOSE pre-emptively bumps state sequence Anna Schumaker
2020-09-22 14:22 ` Benjamin Coddington
2020-09-22 14:31 ` Anna Schumaker
[not found] ` <CAFX2JfkQSonD=Hnn40Y8A62rfmoQ2d8_ugNvOmg+Ny8zJ6dLAg@mail.gmail.com>
2020-09-22 15:46 ` Benjamin Coddington
2020-09-22 15:53 ` Anna Schumaker
2020-09-22 16:11 ` Anna Schumaker
2020-09-22 18:47 ` Benjamin Coddington
2020-09-22 18:51 ` Anna Schumaker
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=469888e8990e53fefbff77d71b6e814237333dc8.1600686204.git.bcodding@redhat.com \
--to=bcodding@redhat.com \
--cc=anna.schumaker@netapp.com \
--cc=linux-nfs@vger.kernel.org \
--cc=trond.myklebust@hammerspace.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).