[Patch 2/2] Enhancements to vfs.stp (with minor modifications)

Stone, Joshua I joshua.i.stone@intel.com
Wed Jun 11 20:45:00 GMT 2008


K.Prasad wrote:
> On Mon, Jun 09, 2008 at 11:10:08AM -0700, Stone, Joshua I wrote:
>> K.Prasad wrote:
>>> +function __address_inode:long (page:long) %{ /* pure */
>>> +	struct page *page = (struct page *)(long)THIS->page;
>>> +	struct address_space *mapping =
>>> +			(struct address_space *)(long)THIS;
>> 
>> This typecast looks extremely suspect...
>  Given that the same assignment sequence is done in __page_bdev
> without a typecast for address_space I will change the above two
> lines to become:
> +   struct page *page = (struct page *)(long)THIS->page;
> +   struct address_space *mapping = (long)THIS;

Sorry I wasn't clear.  I have no issue with the syntax of the cast.  The
problem is that you're casting the THIS pointer to a completely
different type.

In __page_bdev() it uses "kread(&(page->mapping))", which seems more
like what you would want here.

Josh



More information about the Systemtap mailing list