diff options
author | Steve Dickson <steved@redhat.com> | 2008-01-29 15:02:30 -0500 |
---|---|---|
committer | Steve Dickson <steved@redhat.com> | 2008-01-29 15:02:30 -0500 |
commit | a0630d519e87f5c5d851d3127085a50592bb20b4 (patch) | |
tree | 589aff766c2131f715b595de40ed19b57719b0cb /tapset/nfs4errno.stp | |
download | systemtap-a0630d519e87f5c5d851d3127085a50592bb20b4.tar.gz systemtap-a0630d519e87f5c5d851d3127085a50592bb20b4.tar.xz systemtap-a0630d519e87f5c5d851d3127085a50592bb20b4.zip |
Initial Commit
Diffstat (limited to 'tapset/nfs4errno.stp')
-rw-r--r-- | tapset/nfs4errno.stp | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/tapset/nfs4errno.stp b/tapset/nfs4errno.stp new file mode 100644 index 0000000..eb5aee7 --- /dev/null +++ b/tapset/nfs4errno.stp @@ -0,0 +1,77 @@ + +%{ +#include <linux/kernel.h> +#include <linux/linkage.h> +#include <linux/time.h> +#include <linux/errno.h> +#include <linux/fs.h> +#include <linux/stat.h> +#include <linux/fcntl.h> +#include <linux/net.h> +#include <linux/in.h> +#include <linux/namei.h> +#include <linux/unistd.h> +#include <linux/slab.h> +#include <linux/nfs.h> +#include <linux/nfs4.h> +%} + +function nfs4error:string(err:long) +%{ + static struct { + int nfserr; + char *string; + } nfs_errtbl[] = { + { NFS4_OK, "Success" }, + { NFS4ERR_PERM, "NFS4ERR_PERM" }, + { NFS4ERR_NOENT, "NFS4ERR_NOENT" }, + { NFS4ERR_IO, "NFS4ERR_IO" }, + { NFS4ERR_NXIO, "NFS4ERR_NXIO" }, + { NFS4ERR_ACCESS, "NFS4ERR_ACCESS" }, + { NFS4ERR_EXIST, "NFS4ERR_EXIST" }, + { NFS4ERR_XDEV, "NFS4ERR_XDEV" }, + { NFS4ERR_NOTDIR, "NFS4ERR_NOTDIR" }, + { NFS4ERR_ISDIR, "NFS4ERR_ISDIR" }, + { NFS4ERR_INVAL, "NFS4ERR_INVAL" }, + { NFS4ERR_FBIG, "NFS4ERR_FBIG" }, + { NFS4ERR_NOSPC, "NFS4ERR_NOSPC" }, + { NFS4ERR_ROFS, "NFS4ERR_ROFS" }, + { NFS4ERR_MLINK, "NFS4ERR_MLINK" }, + { NFS4ERR_NAMETOOLONG, "NFS4ERR_NAMETOOLONG" }, + { NFS4ERR_NOTEMPTY, "NFS4ERR_NOTEMPTY" }, + { NFS4ERR_DQUOT, "NFS4ERR_DQUOT" }, + { NFS4ERR_STALE, "NFS4ERR_STALE" }, + { NFS4ERR_BADHANDLE, "NFS4ERR_BADHANDLE" }, + { NFS4ERR_BADOWNER, "NFS4ERR_BADOWNER" }, + { NFS4ERR_BADNAME, "NFS4ERR_BADNAME" }, + { NFS4ERR_BAD_COOKIE, "NFS4ERR_BAD_COOKIE" }, + { NFS4ERR_NOTSUPP, "NFS4ERR_NOTSUPP" }, + { NFS4ERR_TOOSMALL, "NFS4ERR_TOOSMALL" }, + { NFS4ERR_SERVERFAULT, "NFS4ERR_SERVERFAULT" }, + { NFS4ERR_BADTYPE, "NFS4ERR_BADTYPE" }, + { NFS4ERR_LOCKED, "NFS4ERR_LOCKED" }, + { NFS4ERR_RESOURCE, "NFS4ERR_RESOURCE" }, + { NFS4ERR_SYMLINK, "NFS4ERR_SYMLINK" }, + { NFS4ERR_OP_ILLEGAL, "NFS4ERR_OP_ILLEGAL" }, + { NFS4ERR_DEADLOCK, "NFS4ERR_DEADLOCK" }, + { NFS4ERR_WRONGSEC, "NFS4ERR_WRONGSEC" }, /* FIXME: this needs + * to be handled by a + * middle-layer. + */ + { -1, "Bad Error Code" } + }; + int i; + int tabsz = (sizeof(nfs_errtbl)/sizeof(nfs_errtbl[0])); + + for (i = 0; i < tabsz; i++) { + if (nfs_errtbl[i].nfserr == THIS->err) { + break; + } + } + if (i == tabsz) + snprintf(THIS->__retvalue, MAXSTRINGLEN, "nfs4err %d", ntohl(THIS->err)); + else + snprintf(THIS->__retvalue, MAXSTRINGLEN, + "nfs4err %d(%s)", nfs_errtbl[i].nfserr, nfs_errtbl[i].string); + +%} |