diff options
author | zack <zack@FreeBSD.org> | 2011-07-16 08:51:09 +0000 |
---|---|---|
committer | zack <zack@FreeBSD.org> | 2011-07-16 08:51:09 +0000 |
commit | 1fab7143c5a0cf07ad84fe178bb29590f5cd2733 (patch) | |
tree | 692e5096886a1c840f65311eb5a7921341945941 /sys/fs/nfs/nfsdport.h | |
parent | cbcc560b1ef4e3268956232dcc43c9f45bbb9e42 (diff) | |
download | FreeBSD-src-1fab7143c5a0cf07ad84fe178bb29590f5cd2733.zip FreeBSD-src-1fab7143c5a0cf07ad84fe178bb29590f5cd2733.tar.gz |
Add DEXITCODE plumbing to NFS.
Isilon has the concept of an in-memory exit-code ring that saves the last exit
code of a function and allows for stack tracing. This is very helpful when
debugging tough issues.
This patch is essentially a no-op for BSD at this point, until we upstream
the dexitcode logic itself. The patch adds DEXITCODE calls to every NFS
function that returns an errno error code. A number of code paths were also
reorganized to have single exit paths, to reduce code duplication.
Submitted by: David Kwan <dkwan@isilon.com>
Reviewed by: rmacklem
Approved by: zml (mentor)
MFC after: 2 weeks
Diffstat (limited to 'sys/fs/nfs/nfsdport.h')
-rw-r--r-- | sys/fs/nfs/nfsdport.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/sys/fs/nfs/nfsdport.h b/sys/fs/nfs/nfsdport.h index a3f05db..529ada2 100644 --- a/sys/fs/nfs/nfsdport.h +++ b/sys/fs/nfs/nfsdport.h @@ -57,6 +57,22 @@ struct nfsexstuff { int nes_secflavors[MAXSECFLAVORS]; /* and the flavors */ }; +/* + * These are NO-OPS for BSD until Isilon upstreams EXITCODE support. + * EXITCODE is an in-memory ring buffer that holds the routines failing status. + * This is a valuable tool to use when debugging and analyzing issues. + * In addition to recording a routine's failing status, it offers + * logging of routines for call stack tracing. + * EXITCODE should be used only in routines that return a true errno value, as + * that value will be formatted to a displayable errno string. Routines that + * return regular int status that are not true errno should not set EXITCODE. + * If you want to log routine tracing, you can add EXITCODE(0) to any routine. + * NFS extended the EXITCODE with EXITCODE2 to record either the routine's + * exit errno status or the nd_repstat. + */ +#define NFSEXITCODE(error) +#define NFSEXITCODE2(error, nd) + #define NFSVNO_EXINIT(e) ((e)->nes_exflag = 0) #define NFSVNO_EXPORTED(e) ((e)->nes_exflag & MNT_EXPORTED) #define NFSVNO_EXRDONLY(e) ((e)->nes_exflag & MNT_EXRDONLY) |