diff options
author | Steve Dickson <steved@redhat.com> | 2008-08-08 11:51:53 -0400 |
---|---|---|
committer | Steve Dickson <steved@redhat.com> | 2008-08-08 11:51:53 -0400 |
commit | 6e668bfb18b75b4825bdc51ee8573512b971e204 (patch) | |
tree | 40249133f941ed3528246465e5d3505e412cff32 /tapset | |
parent | 4bed56a6bbda26a0824133f29c66ba77d6354396 (diff) | |
download | systemtap-6e668bfb18b75b4825bdc51ee8573512b971e204.tar.gz systemtap-6e668bfb18b75b4825bdc51ee8573512b971e204.tar.xz systemtap-6e668bfb18b75b4825bdc51ee8573512b971e204.zip |
Ported d_path to the 2.6.26 kernel
Signed-off-by: Steve Dickson <steved@redhat.com>
Diffstat (limited to 'tapset')
-rw-r--r-- | tapset/fs.stp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/tapset/fs.stp b/tapset/fs.stp index 246fb79..a6ba788 100644 --- a/tapset/fs.stp +++ b/tapset/fs.stp @@ -6,24 +6,26 @@ probe fs.read.return = kernel.function("vfs_read").return { probe fs.write.return = kernel.function("vfs_write").return { bytes = ($return > 0 ? $return : 0) } - function file2name:string(filep:long) %{ char *start = NULL, buf[MAXSTRINGLEN]; + struct file *file = (struct file *)(long) kread(&(THIS->filep)); +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27) struct dentry *dentry = NULL; struct vfsmount *mnt = NULL; - struct file *file = (struct file *)(long) kread(&(THIS->filep)); if (file) { -/* - mnt = (struct vfsmount *) kread(&(file->f_path.mnt)); - dentry = (struct dentry *) kread(&(file->f_path.dentry)); -*/ mnt = (struct vfsmount *) kread(&(file->f_vfsmnt)); dentry = (struct dentry *) kread(&(file->f_dentry)); } if (mnt && dentry) start = d_path(dentry, mnt, buf, MAXSTRINGLEN); +#else + struct path *path = NULL; + + if (file) + start = d_path(&(file->f_path), buf, MAXSTRINGLEN); +#endif if (start > 0) strlcpy(THIS->__retvalue, start, MAXSTRINGLEN); |