From: Dai Ngo <dai.ngo@oracle.com>
To: chuck.lever@oracle.com, jlayton@kernel.org
Cc: linux-nfs@vger.kernel.org, linux-fsdevel@vger.kernel.org
Subject: [PATCH v4 4/4] NFSD: add trace point to track when write delegation is granted
Date: Sat, 20 May 2023 14:36:35 -0700 [thread overview]
Message-ID: <1684618595-4178-5-git-send-email-dai.ngo@oracle.com> (raw)
In-Reply-To: <1684618595-4178-1-git-send-email-dai.ngo@oracle.com>
Add trace point to track whether read or write delegation is granted.
Signed-off-by: Dai Ngo <dai.ngo@oracle.com>
---
fs/nfsd/nfs4state.c | 8 +++++---
fs/nfsd/trace.h | 1 +
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index 3f98b7485c72..b90b74a5e66e 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -5621,11 +5621,13 @@ nfs4_open_delegation(struct nfsd4_open *open, struct nfs4_ol_stateid *stp,
memcpy(&open->op_delegate_stateid, &dp->dl_stid.sc_stateid, sizeof(dp->dl_stid.sc_stateid));
- trace_nfsd_deleg_read(&dp->dl_stid.sc_stateid);
- if (open->op_share_access & NFS4_SHARE_ACCESS_WRITE)
+ if (open->op_share_access & NFS4_SHARE_ACCESS_WRITE) {
open->op_delegate_type = NFS4_OPEN_DELEGATE_WRITE;
- else
+ trace_nfsd_deleg_write(&dp->dl_stid.sc_stateid);
+ } else {
open->op_delegate_type = NFS4_OPEN_DELEGATE_READ;
+ trace_nfsd_deleg_read(&dp->dl_stid.sc_stateid);
+ }
nfs4_put_stid(&dp->dl_stid);
return;
out_no_deleg:
diff --git a/fs/nfsd/trace.h b/fs/nfsd/trace.h
index 4183819ea082..a14cf8684255 100644
--- a/fs/nfsd/trace.h
+++ b/fs/nfsd/trace.h
@@ -607,6 +607,7 @@ DEFINE_STATEID_EVENT(layout_recall_release);
DEFINE_STATEID_EVENT(open);
DEFINE_STATEID_EVENT(deleg_read);
+DEFINE_STATEID_EVENT(deleg_write);
DEFINE_STATEID_EVENT(deleg_return);
DEFINE_STATEID_EVENT(deleg_recall);
--
2.9.5
next prev parent reply other threads:[~2023-05-20 21:37 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-20 21:36 [PATCH v4 0/4] NFSD: add support for NFSv4 write delegation Dai Ngo
2023-05-20 21:36 ` [PATCH v4 1/4] locks: allow support for " Dai Ngo
2023-05-21 16:27 ` Jeff Layton
2023-05-20 21:36 ` [PATCH v4 2/4] NFSD: enable " Dai Ngo
2023-05-20 21:36 ` [PATCH v4 3/4] NFSD: handle GETATTR conflict with " Dai Ngo
2023-05-21 16:30 ` Chuck Lever III
2023-05-21 16:49 ` Jeff Layton
2023-05-21 18:48 ` dai.ngo
2023-05-21 23:08 ` Jeff Layton
2023-05-22 2:31 ` Chuck Lever
2023-05-22 2:56 ` dai.ngo
2023-05-22 3:56 ` dai.ngo
2023-05-22 13:16 ` Chuck Lever III
2023-05-22 13:49 ` Jeff Layton
2023-05-22 17:10 ` dai.ngo
2023-05-20 21:36 ` Dai Ngo [this message]
2023-05-21 16:08 ` [PATCH v4 0/4] NFSD: add support for NFSv4 " Chuck Lever III
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=1684618595-4178-5-git-send-email-dai.ngo@oracle.com \
--to=dai.ngo@oracle.com \
--cc=chuck.lever@oracle.com \
--cc=jlayton@kernel.org \
--cc=linux-fsdevel@vger.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 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).