diff options
author | rwatson <rwatson@FreeBSD.org> | 2009-03-24 23:16:48 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2009-03-24 23:16:48 +0000 |
commit | 8f6024ae234d5365fe6142a4d7ad85570839342b (patch) | |
tree | ea04b6367ad730ed0878d25268836432449fbb75 /sys/nfsclient/nfs_subs.c | |
parent | 71ae7c9315fc12283d86f2791327d9cc7f74c97c (diff) | |
download | FreeBSD-src-8f6024ae234d5365fe6142a4d7ad85570839342b.zip FreeBSD-src-8f6024ae234d5365fe6142a4d7ad85570839342b.tar.gz |
Fix two bugs in DTrace tracing of accesscache and attrcache load events:
- Trace non-error loads into the access cache once, not zero times or
twice.
- Sometimes attr cache loads fail due to a race, in which case they are
aborted leading to an invalidation; in this case, trace only the flush,
not a load.
MFC after: 1 month
Sponsored by: Google, Inc.
Diffstat (limited to 'sys/nfsclient/nfs_subs.c')
-rw-r--r-- | sys/nfsclient/nfs_subs.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/sys/nfsclient/nfs_subs.c b/sys/nfsclient/nfs_subs.c index 8d80616..e9b7f35 100644 --- a/sys/nfsclient/nfs_subs.c +++ b/sys/nfsclient/nfs_subs.c @@ -755,12 +755,16 @@ nfs_loadattrcache(struct vnode **vpp, struct mbuf **mdp, caddr_t *dposp, vaper->va_mtime = np->n_mtim; } } + +#ifdef KDTRACE_HOOKS + if (np->n_attrstamp != 0) + KDTRACE_NFS_ATTRCACHE_LOAD_DONE(vp, &np->n_vattr, 0); +#endif mtx_unlock(&np->n_mtx); out: -#ifdef KDRACE_HOOKS - if (np != NULL) - KDTRACE_NFS_ATTRCACHE_LOAD_DONE(vp, error == 0 ? &np->n_vattr - : NULL, error); +#ifdef KDTRACE_HOOKS + if (error) + KDTRACE_NFS_ATTRCACHE_LOAD_DONE(vp, NULL, error); #endif return (error); } |