diff options
author | Jeff Layton <jlayton@poochiereds.net> | 2015-11-17 06:52:23 -0500 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2016-01-14 17:32:51 -0500 |
commit | 6e8b50d16a757d53f8817acecba97c5d4aa1cf65 (patch) | |
tree | 1d8846d614705a8475543c575e026e87e6b3eaa8 /fs/nfsd/nfsfh.h | |
parent | 6b9b21073d3b250e17812cd562fffc9006962b39 (diff) |
nfsd: add new io class tracepoint
Add some new tracepoints in the nfsd read/write codepaths. The idea
is that this will give us the ability to measure how long each phase of
a read or write operation takes.
Signed-off-by: Jeff Layton <jeff.layton@primarydata.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd/nfsfh.h')
-rw-r--r-- | fs/nfsd/nfsfh.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/fs/nfsd/nfsfh.h b/fs/nfsd/nfsfh.h index 2087bae17582..0770bcb543c8 100644 --- a/fs/nfsd/nfsfh.h +++ b/fs/nfsd/nfsfh.h | |||
@@ -7,6 +7,7 @@ | |||
7 | #ifndef _LINUX_NFSD_NFSFH_H | 7 | #ifndef _LINUX_NFSD_NFSFH_H |
8 | #define _LINUX_NFSD_NFSFH_H | 8 | #define _LINUX_NFSD_NFSFH_H |
9 | 9 | ||
10 | #include <linux/crc32.h> | ||
10 | #include <linux/sunrpc/svc.h> | 11 | #include <linux/sunrpc/svc.h> |
11 | #include <uapi/linux/nfsd/nfsfh.h> | 12 | #include <uapi/linux/nfsd/nfsfh.h> |
12 | 13 | ||
@@ -205,6 +206,28 @@ static inline bool fh_fsid_match(struct knfsd_fh *fh1, struct knfsd_fh *fh2) | |||
205 | return true; | 206 | return true; |
206 | } | 207 | } |
207 | 208 | ||
209 | #ifdef CONFIG_CRC32 | ||
210 | /** | ||
211 | * knfsd_fh_hash - calculate the crc32 hash for the filehandle | ||
212 | * @fh - pointer to filehandle | ||
213 | * | ||
214 | * returns a crc32 hash for the filehandle that is compatible with | ||
215 | * the one displayed by "wireshark". | ||
216 | */ | ||
217 | |||
218 | static inline u32 | ||
219 | knfsd_fh_hash(struct knfsd_fh *fh) | ||
220 | { | ||
221 | return ~crc32_le(0xFFFFFFFF, (unsigned char *)&fh->fh_base, fh->fh_size); | ||
222 | } | ||
223 | #else | ||
224 | static inline u32 | ||
225 | knfsd_fh_hash(struct knfsd_fh *fh) | ||
226 | { | ||
227 | return 0; | ||
228 | } | ||
229 | #endif | ||
230 | |||
208 | #ifdef CONFIG_NFSD_V3 | 231 | #ifdef CONFIG_NFSD_V3 |
209 | /* | 232 | /* |
210 | * The wcc data stored in current_fh should be cleared | 233 | * The wcc data stored in current_fh should be cleared |