From f5afe1607cb8fdd84a8d3593aaeb0c191e7013a1 Mon Sep 17 00:00:00 2001
From: William Cohen <wcohen@redhat.com>
Date: Fri, 12 Mar 2010 17:44:28 -0500
Subject: Use the @defined rather than kernel_v in the inode-watch.stp

---
 doc/tutorial.tex | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

(limited to 'doc/tutorial.tex')

diff --git a/doc/tutorial.tex b/doc/tutorial.tex
index 609850ab..2db521b6 100644
--- a/doc/tutorial.tex
+++ b/doc/tutorial.tex
@@ -450,13 +450,13 @@ This example also demonstrates pasting numeric command-line arguments
 probe kernel.function ("vfs_write"),
       kernel.function ("vfs_read")
 {
-%( kernel_v >= "2.6.20" %?
-  dev_nr = $file->f_path->dentry->d_inode->i_sb->s_dev
-  inode_nr = $file->f_path->dentry->d_inode->i_ino
-%:
-  dev_nr = $file->f_dentry->d_inode->i_sb->s_dev
-  inode_nr = $file->f_dentry->d_inode->i_ino
-%)
+  if (@defined($file->f_path->dentry)) {
+    dev_nr = $file->f_path->dentry->d_inode->i_sb->s_dev
+    inode_nr = $file->f_path->dentry->d_inode->i_ino
+  } else {
+    dev_nr = $file->f_dentry->d_inode->i_sb->s_dev
+    inode_nr = $file->f_dentry->d_inode->i_ino
+  }
 
   if (dev_nr == ($1 << 20 | $2) # major/minor device
       && inode_nr == $3)
-- 
cgit 

