diff options
author | David Smith <dsmith@redhat.com> | 2010-03-30 15:53:51 -0500 |
---|---|---|
committer | David Smith <dsmith@redhat.com> | 2010-03-30 15:53:51 -0500 |
commit | 1713a05f2afa6df663a7fd3552849759a7d3ff48 (patch) | |
tree | bd182e9ce4c075cf4cde34a273966761fa3edbff /tapset/ioblock.stp | |
parent | eda8b449152cf0f864d2cd250fb2b7a2945bc996 (diff) | |
download | systemtap-steved-1713a05f2afa6df663a7fd3552849759a7d3ff48.tar.gz systemtap-steved-1713a05f2afa6df663a7fd3552849759a7d3ff48.tar.xz systemtap-steved-1713a05f2afa6df663a7fd3552849759a7d3ff48.zip |
PR 9871 (partial) fix. Removed some embedded-C in ioblock.stp/vfs.stp.
* tapset/dev.stp: Added a bdevname() script function.
* tapset/ioblock.stp: Rewrote the embedded-C devname function to just use
bdevname() script function.
* tapset/vfs.stp: Removed embedded-C __bdevname() C function. Calls
bdevname() script function instead.
* tapset/string.stp: Added isdigit() function.
Diffstat (limited to 'tapset/ioblock.stp')
-rw-r--r-- | tapset/ioblock.stp | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/tapset/ioblock.stp b/tapset/ioblock.stp index 761e7df7..6376ac23 100644 --- a/tapset/ioblock.stp +++ b/tapset/ioblock.stp @@ -62,18 +62,9 @@ function __bio_start_sect:long(bio:long) /* returns the block device name */ function __bio_devname:string(bio:long) -%{ /* pure */ - char b[BDEVNAME_SIZE]; - struct bio *bio = (struct bio *)(long)THIS->bio; - struct block_device *bdev = kread(&(bio->bi_bdev)); - if (bdev == NULL) { - strlcpy(THIS->__retvalue, "N/A", MAXSTRINGLEN); - } else { - const char *name = bdevname(bdev, b); /* FIXME: deref hazard! */ - deref_string(THIS->__retvalue, name, MAXSTRINGLEN); - } - CATCH_DEREF_FAULT(); -%} +{ + return bdevname(@cast(bio, "bio")->bi_bdev) +} global BIO_READ = 0, BIO_WRITE = 1 |