lkml.org 
[lkml]   [2011]   [Mar]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 02/36] scsi,rcu: convert call_rcu(fc_rport_free_rcu) to kfree_rcu()
From
Date
On Tue, 2011-03-22 at 23:50 -0700, Paul E. McKenney wrote:
> The kfree_rcu() definition is as
> follows:
>
> #define kfree_rcu(ptr, rcu_head) \
> __kfree_rcu(&((ptr)->rcu_head), offsetof(typeof(*(ptr)), rcu_head))

Isn't this one of those cases where the obvious use of the interface is
definitely wrong?

It's also another nasty pseudo C prototype. I know we do this sort of
thing for container_of et al, but I don't really think we want to extend
it.

Why not make the interface take a pointer to the embedding structure and
one to the rcu_head ... that way all pointer mathematics can be
contained inside the RCU routines.

James




\
 
 \ /
  Last update: 2011-03-23 15:09    [W:0.064 / U:5.796 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site