per_cpu data question
A message that is not in the archive (sent off-list or not yet received): [email protected]
In message <[email protected]> you write:
Quoted 8 lines
Hi Rusty,
I can't do this -
struct rcu_data *rdata; rdata = &get_cpu_var(rcu_data);Has this been deliberately made illegal ?
No, I suck. Lvalues continue to haunt me. This works for me.
BTW, I prefer to have bug reports cc'd to linux-kernel, so the results are archived. Plus, public humiliation is good for the soul.
include/linux/percpu.h +2 -1
@@ -3,7 +3,8 @@#include <linux/spinlock.h> /* For preempt_disable() */ #include <asm/percpu.h> -#define get_cpu_var (var) ({ preempt_disable(); __get_cpu_var(var); }) +/* Must be an lvalue. */ +#define get_cpu_var (var) (*({ preempt_disable(); &__get_cpu_var(var); }))#define put_cpu_var (var) preempt_enable()#endif /* __LINUX_PERCPU_H */
--
Anyone who quotes me in their sig is an idiot. -- Rusty Russell.