aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/dir.c
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2013-08-19 18:59:33 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2013-08-22 08:58:17 -0400
commitf4ce1299b329e96bb247c95c4fee8809827d6931 (patch)
treeb4056d4f78b0594f84c8e4b3beda565a05751993 /fs/nfs/dir.c
parent1264a2f053a32376696e51184f086d35113e75ff (diff)
NFS: Add event tracing for generic NFS events
Add tracepoints for inode attribute updates, attribute revalidation, writeback start/end fsync start/end, attribute change start/end, permission check start/end. The intention is to enable performance tracing using 'perf'as well as improving debugging. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/dir.c')
-rw-r--r--fs/nfs/dir.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c
index 5d737bd52288..be3da6fe3ad4 100644
--- a/fs/nfs/dir.c
+++ b/fs/nfs/dir.c
@@ -43,6 +43,8 @@
43#include "internal.h" 43#include "internal.h"
44#include "fscache.h" 44#include "fscache.h"
45 45
46#include "nfstrace.h"
47
46/* #define NFS_DEBUG_VERBOSE 1 */ 48/* #define NFS_DEBUG_VERBOSE 1 */
47 49
48static int nfs_opendir(struct inode *, struct file *); 50static int nfs_opendir(struct inode *, struct file *);
@@ -2178,9 +2180,11 @@ static int nfs_do_access(struct inode *inode, struct rpc_cred *cred, int mask)
2178 struct nfs_access_entry cache; 2180 struct nfs_access_entry cache;
2179 int status; 2181 int status;
2180 2182
2183 trace_nfs_access_enter(inode);
2184
2181 status = nfs_access_get_cached(inode, cred, &cache); 2185 status = nfs_access_get_cached(inode, cred, &cache);
2182 if (status == 0) 2186 if (status == 0)
2183 goto out; 2187 goto out_cached;
2184 2188
2185 /* Be clever: ask server to check for all possible rights */ 2189 /* Be clever: ask server to check for all possible rights */
2186 cache.mask = MAY_EXEC | MAY_WRITE | MAY_READ; 2190 cache.mask = MAY_EXEC | MAY_WRITE | MAY_READ;
@@ -2193,13 +2197,15 @@ static int nfs_do_access(struct inode *inode, struct rpc_cred *cred, int mask)
2193 if (!S_ISDIR(inode->i_mode)) 2197 if (!S_ISDIR(inode->i_mode))
2194 set_bit(NFS_INO_STALE, &NFS_I(inode)->flags); 2198 set_bit(NFS_INO_STALE, &NFS_I(inode)->flags);
2195 } 2199 }
2196 return status; 2200 goto out;
2197 } 2201 }
2198 nfs_access_add_cache(inode, &cache); 2202 nfs_access_add_cache(inode, &cache);
2203out_cached:
2204 if ((mask & ~cache.mask & (MAY_READ | MAY_WRITE | MAY_EXEC)) != 0)
2205 status = -EACCES;
2199out: 2206out:
2200 if ((mask & ~cache.mask & (MAY_READ | MAY_WRITE | MAY_EXEC)) == 0) 2207 trace_nfs_access_exit(inode, status);
2201 return 0; 2208 return status;
2202 return -EACCES;
2203} 2209}
2204 2210
2205static int nfs_open_permission_mask(int openflags) 2211static int nfs_open_permission_mask(int openflags)