]> sourceware.org Git - systemtap.git/commitdiff
tapset: use autocast types in __bio_start_sect()
authorJosh Stone <jistone@redhat.com>
Wed, 11 Jun 2014 01:30:38 +0000 (18:30 -0700)
committerJosh Stone <jistone@redhat.com>
Wed, 11 Jun 2014 01:30:38 +0000 (18:30 -0700)
tapset/linux/ioblock.stp

index 9a61b64f1f66c26604d8b0193579c6016e021ae7..18d059ac929536c43f60c192a7f6620ec536318e 100644 (file)
@@ -53,9 +53,11 @@ function bio_rw_str(rw:long)
 /* returns start sector */
 function __bio_start_sect:long(bio:long)
 {
-    bi_bdev = bio ? @cast(bio, "bio")->bi_bdev : 0
-    bd_part = bi_bdev ? @cast(bi_bdev, "block_device")->bd_part : 0
-    return bd_part ? @cast(bd_part, "hd_struct")->start_sect : -1
+    try {
+        return @cast(bio, "bio")->bi_bdev->bd_part->start_sect
+    } catch {
+        return -1
+    }
 }
 
 /* returns the block device name */
This page took 0.029865 seconds and 5 git commands to generate.