summaryrefslogtreecommitdiffstats
path: root/fs/nfsd/trace.h
diff options
context:
space:
mode:
authorTrond Myklebust <trondmy@gmail.com>2020-01-14 12:02:44 -0500
committerJ. Bruce Fields <bfields@redhat.com>2020-02-06 11:22:55 -0500
commit689827cd5bfe89e4900db7e1c0c713083a76d04c (patch)
tree278059c769f2fa8e2fa318d37c075a33fc347097 /fs/nfsd/trace.h
parentc19285596de699e4602f9c89785e6b8c29422286 (diff)
downloadlinux-689827cd5bfe89e4900db7e1c0c713083a76d04c.tar.bz2
nfsd: convert file cache to use over/underflow safe refcount
Use the 'refcount_t' type instead of 'atomic_t' for improved refcounting safety. Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd/trace.h')
-rw-r--r--fs/nfsd/trace.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/nfsd/trace.h b/fs/nfsd/trace.h
index 17ecef404e5b..06dd0d337049 100644
--- a/fs/nfsd/trace.h
+++ b/fs/nfsd/trace.h
@@ -201,7 +201,7 @@ DECLARE_EVENT_CLASS(nfsd_file_class,
TP_fast_assign(
__entry->nf_hashval = nf->nf_hashval;
__entry->nf_inode = nf->nf_inode;
- __entry->nf_ref = atomic_read(&nf->nf_ref);
+ __entry->nf_ref = refcount_read(&nf->nf_ref);
__entry->nf_flags = nf->nf_flags;
__entry->nf_may = nf->nf_may;
__entry->nf_file = nf->nf_file;
@@ -250,7 +250,7 @@ TRACE_EVENT(nfsd_file_acquire,
__entry->hash = hash;
__entry->inode = inode;
__entry->may_flags = may_flags;
- __entry->nf_ref = nf ? atomic_read(&nf->nf_ref) : 0;
+ __entry->nf_ref = nf ? refcount_read(&nf->nf_ref) : 0;
__entry->nf_flags = nf ? nf->nf_flags : 0;
__entry->nf_may = nf ? nf->nf_may : 0;
__entry->nf_file = nf ? nf->nf_file : NULL;