diff options
| author | Steve Dickson <steved@redhat.com> | 2008-04-09 11:22:50 -0400 |
|---|---|---|
| committer | Steve Dickson <steved@redhat.com> | 2008-04-09 11:22:50 -0400 |
| commit | 1925e3e12148a967eba84111910b61d5f482aa35 (patch) | |
| tree | 78815fdc5d6ffeb4b970b9d6cd69a809c7e2985c | |
| parent | 8de0935f97b3cea618a039e45eaaeb4934c920ea (diff) | |
Ported svc_export_dump to a 2.6.25 kernel.
| -rw-r--r-- | tapset/svc_export.stp | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/tapset/svc_export.stp b/tapset/svc_export.stp index 72bce5c..9fe7f13 100644 --- a/tapset/svc_export.stp +++ b/tapset/svc_export.stp @@ -1,5 +1,8 @@ %{ #include <linux/fs.h> +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24) +#include <linux/path.h> +#endif #include <linux/nfsd/export.h> %} @@ -9,22 +12,37 @@ function svc_export_dump:string(_exp:long) struct dentry *dentry = NULL; struct vfsmount *mnt = NULL; char buf[MAXSTRINGLEN], *fname=NULL; +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24) + struct path ex_path; +#endif int cc=0; if (exp <= 0) { sprintf(buf+cc, "exp NULL"); } else { +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24) sprintf(buf+cc, "exp %p path %s flg 0x%x fsid %d nflavors %d\n", exp, exp->ex_path > 0 ? exp->ex_path : NULL, exp->ex_flags, exp->ex_fsid, exp->ex_nflavors); cc = strlen(buf); - dentry = (struct dentry *) (long) kread(&(exp->ex_dentry)); mnt = (struct vfsmount *) kread(&(exp->ex_mnt)); if (mnt && dentry) fname = d_path(dentry, mnt, buf, MAXSTRINGLEN); sprintf(buf+cc, " mnt %p dentry %p(%s)", exp->ex_mnt, exp->ex_dentry, fname > 0 ? fname : NULL); +#else + sprintf(buf+cc, "exp %p path %s flg 0x%x fsid %d nflavors %d\n", + exp, exp->ex_pathname > 0 ? exp->ex_pathname : NULL, + exp->ex_flags, exp->ex_fsid, exp->ex_nflavors); + cc = strlen(buf); + ex_path.dentry = (struct dentry *) (long) kread(&(exp->ex_path.dentry)); + ex_path.mnt = (struct vfsmount *) kread(&(exp->ex_path.mnt)); + if (ex_path.mnt && ex_path.dentry) + fname = d_path(&ex_path, buf, MAXSTRINGLEN); + sprintf(buf+cc, " mnt %p dentry %p(%s)", + ex_path.mnt, ex_path.dentry, fname > 0 ? fname : NULL); +#endif } snprintf(THIS->__retvalue, MAXSTRINGLEN, "%s", buf); |
