Re: [PATCH 2/2] target: use RCU_INIT_POINTER() when NULLing.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, May 02, 2016 at 10:57:38AM -0700, Paul E. McKenney wrote:
> -#define rcu_assign_pointer(p, v) smp_store_release(&p, RCU_INITIALIZER(v))
> +#define rcu_assign_pointer(p, v) \
> +({ \
> +	uintptr_t _r_a_p__v = (uintptr_t)(v); \
> +	\
> +	if (__builtin_constant_p(v) && (_r_a_p__v) == (uintptr_t)NULL) \
> +		WRITE_ONCE((p), (typeof(p))(_r_a_p__v)); \
> +	else \
> +		smp_store_release(&p, RCU_INITIALIZER((typeof(p))_r_a_p__v)); \
> +	_r_a_p__v; \
> +})

Can't we turn it into an inline (would need different calling
conventions for p, though).
--
To unsubscribe from this list: send the line "unsubscribe target-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux SCSI]     [Kernel Newbies]     [Linux SCSI Target Infrastructure]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Device Mapper]

  Powered by Linux