netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Patrick McHardy <kaber@trash.net>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, Patrick McHardy <kaber@trash.net>,
	netfilter-devel@vger.kernel.org
Subject: list_nulls 05/07: add hlist_nulls_add_head and hlist_nulls_del
Date: Sat, 13 Jun 2009 15:09:41 +0200 (MEST)	[thread overview]
Message-ID: <20090613130941.2112.19054.sendpatchset@x2.localnet> (raw)
In-Reply-To: <20090613130934.2112.65299.sendpatchset@x2.localnet>

commit d219dce76c64f2c883dad0537fa09a56d5ff0a10
Author: Pablo Neira Ayuso <pablo@netfilter.org>
Date:   Sat Jun 13 12:28:57 2009 +0200

    list_nulls: add hlist_nulls_add_head and hlist_nulls_del
    
    This patch adds the hlist_nulls_add_head() function which is
    based on hlist_nulls_add_head_rcu() but without the use of
    rcu_assign_pointer(). It also adds hlist_nulls_del which is
    exactly the same like hlist_nulls_del_rcu().
    
    Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
    Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
    Signed-off-by: Patrick McHardy <kaber@trash.net>

diff --git a/include/linux/list_nulls.h b/include/linux/list_nulls.h
index 93150ec..5d10ae3 100644
--- a/include/linux/list_nulls.h
+++ b/include/linux/list_nulls.h
@@ -56,6 +56,18 @@ static inline int hlist_nulls_empty(const struct hlist_nulls_head *h)
 	return is_a_nulls(h->first);
 }
 
+static inline void hlist_nulls_add_head(struct hlist_nulls_node *n,
+					struct hlist_nulls_head *h)
+{
+	struct hlist_nulls_node *first = h->first;
+
+	n->next = first;
+	n->pprev = &h->first;
+	h->first = n;
+	if (!is_a_nulls(first))
+		first->pprev = &n->next;
+}
+
 static inline void __hlist_nulls_del(struct hlist_nulls_node *n)
 {
 	struct hlist_nulls_node *next = n->next;
@@ -65,6 +77,12 @@ static inline void __hlist_nulls_del(struct hlist_nulls_node *n)
 		next->pprev = pprev;
 }
 
+static inline void hlist_nulls_del(struct hlist_nulls_node *n)
+{
+	__hlist_nulls_del(n);
+	n->pprev = LIST_POISON2;
+}
+
 /**
  * hlist_nulls_for_each_entry	- iterate over list of given type
  * @tpos:	the type * to use as a loop cursor.

  parent reply	other threads:[~2009-06-13 13:09 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-13 13:09 netfilter 00/07: netfilter update Patrick McHardy
2009-06-13 13:09 ` netfilter 01/07: nf_log: fix sleeping function called from invalid context Patrick McHardy
2009-06-13 13:09 ` netfilter 02/07: nf_conntrack: use mod_timer_pending() for conntrack refresh Patrick McHardy
2009-06-13 13:09 ` netfilter 03/07: conntrack: move event caching to conntrack extension infrastructure Patrick McHardy
2009-06-13 13:09 ` netfilter 04/07: conntrack: move helper destruction to nf_ct_helper_destroy() Patrick McHardy
2009-06-13 13:09 ` Patrick McHardy [this message]
2009-06-13 13:09 ` netfilter 06/07: conntrack: optional reliable conntrack event delivery Patrick McHardy
2009-06-13 13:09 ` x_tables 07/07: Convert printk to pr_err Patrick McHardy
2009-06-13 23:53 ` netfilter 00/07: netfilter update David Miller

Reply instructions:

You may reply publicly 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=20090613130941.2112.19054.sendpatchset@x2.localnet \
    --to=kaber@trash.net \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=netfilter-devel@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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).