Date: Wed, 27 May 2020 10:01:31 +0000 (UTC) From: Emmanuel Vadot <manu@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361550 - head/sys/compat/linuxkpi/common/include/linux Message-ID: <202005271001.04RA1VKe046907@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: manu Date: Wed May 27 10:01:30 2020 New Revision: 361550 URL: https://svnweb.freebsd.org/changeset/base/361550 Log: linuxkpi: Add rcu_swap_protected This macros swap an rcu pointer with a normal pointer. The condition only seems to be used for debug/warning under linux, ignore for now. Sponsored-by: The FreeBSD Foundation Reviewed by: hselasky Differential Revision: https://reviews.freebsd.org/D24954 Modified: head/sys/compat/linuxkpi/common/include/linux/rcupdate.h Modified: head/sys/compat/linuxkpi/common/include/linux/rcupdate.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/rcupdate.h Wed May 27 09:31:50 2020 (r361549) +++ head/sys/compat/linuxkpi/common/include/linux/rcupdate.h Wed May 27 10:01:30 2020 (r361550) @@ -97,6 +97,12 @@ (uintptr_t)(v)); \ } while (0) +#define rcu_swap_protected(rcu, ptr, c) do { \ + typeof(ptr) p = rcu_dereference_protected(rcu, c); \ + rcu_assign_pointer(rcu, ptr); \ + (ptr) = p; \ +} while (0) + /* prototypes */ extern void linux_call_rcu(unsigned type, struct rcu_head *ptr, rcu_callback_t func);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202005271001.04RA1VKe046907>