This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]