Backports Archive on lore.kernel.org
 help / color / Atom feed
From: Arend van Spriel <arend.vanspriel@broadcom.com>
To: backports@vger.kernel.org
Cc: Arend van Spriel <arend.vanspriel@broadcom.com>
Subject: [PATCH 3/3] backport: rcupdate: add rcu_head_init and rcu_head_after_call_rcu
Date: Sun, 31 Mar 2019 23:12:42 +0200
Message-ID: <1554066762-20128-3-git-send-email-arend.vanspriel@broadcom.com> (raw)
In-Reply-To: <1554066762-20128-1-git-send-email-arend.vanspriel@broadcom.com>

Include static inline functions that were added by commit
74de6960c99d ("rcu: Provide functions for determining if call_rcu()
has been invoked").

Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
---
 backport/backport-include/linux/rcupdate.h | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/backport/backport-include/linux/rcupdate.h b/backport/backport-include/linux/rcupdate.h
index b96ef49..8b9c94e 100644
--- a/backport/backport-include/linux/rcupdate.h
+++ b/backport/backport-include/linux/rcupdate.h
@@ -41,4 +41,22 @@
 #define rcu_dereference_raw(p)	rcu_dereference(p)
 #endif
 
+#if LINUX_VERSION_IS_LESS(5,2,0)
+typedef void (*rcu_callback_t)(struct rcu_head *head);
+
+static inline void rcu_head_init(struct rcu_head *rhp)
+{
+        rhp->func = (rcu_callback_t)~0L;
+}
+
+static inline bool
+rcu_head_after_call_rcu(struct rcu_head *rhp, rcu_callback_t f)
+{
+        if (READ_ONCE(rhp->func) == f)
+                return true;
+        WARN_ON_ONCE(READ_ONCE(rhp->func) != (rcu_callback_t)~0L);
+        return false;
+}
+#endif
+
 #endif /* __BACKPORT_LINUX_RCUPDATE_H */
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe backports" in

      parent reply index

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-31 21:12 [PATCH 1/3] patches: update select queue patches Arend van Spriel
2019-03-31 21:12 ` [PATCH 2/3] backport: add policy field in struct genl_family Arend van Spriel
2019-03-31 21:12 ` Arend van Spriel [this message]

Reply instructions:

You may reply publically to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1554066762-20128-3-git-send-email-arend.vanspriel@broadcom.com \
    --to=arend.vanspriel@broadcom.com \
    --cc=backports@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Backports Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/backports/0 backports/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 backports backports/ https://lore.kernel.org/backports \
		backports@vger.kernel.org backports@archiver.kernel.org
	public-inbox-index backports


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.backports


AGPL code for this site: git clone https://public-inbox.org/ public-inbox