netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: netfilter-devel@vger.kernel.org
Cc: davem@davemloft.net, netdev@vger.kernel.org
Subject: [PATCH 01/12] netfilter: nf_tables: relocate header content to consumer
Date: Mon,  6 May 2019 01:32:54 +0200	[thread overview]
Message-ID: <20190505233305.13650-2-pablo@netfilter.org> (raw)
In-Reply-To: <20190505233305.13650-1-pablo@netfilter.org>

From: Paul Gortmaker <paul.gortmaker@windriver.com>

The nf_tables.h header is used in a lot of files, but it turns out
that there is only one actual user of nft_expr_clone().

Hence we relocate that function to be with the one consumer of it
and avoid having to process it with CPP for all the other files.

This will also enable a reduction in the other headers that the
nf_tables.h itself has to include just to be stand-alone, hence
a pending further significant reduction in the CPP content that
needs to get processed for each netfilter file.

Note that the explicit "inline" has been dropped as part of this
relocation.  In similar changes to this, I believe Dave has asked
this be done, so we free up gcc to make the choice of whether to
inline or not.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
 include/net/netfilter/nf_tables.h | 17 -----------------
 net/netfilter/nft_dynset.c        | 17 +++++++++++++++++
 2 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/include/net/netfilter/nf_tables.h b/include/net/netfilter/nf_tables.h
index 2d5a0a1a87b8..706f744f7308 100644
--- a/include/net/netfilter/nf_tables.h
+++ b/include/net/netfilter/nf_tables.h
@@ -806,23 +806,6 @@ void nft_expr_destroy(const struct nft_ctx *ctx, struct nft_expr *expr);
 int nft_expr_dump(struct sk_buff *skb, unsigned int attr,
 		  const struct nft_expr *expr);
 
-static inline int nft_expr_clone(struct nft_expr *dst, struct nft_expr *src)
-{
-	int err;
-
-	if (src->ops->clone) {
-		dst->ops = src->ops;
-		err = src->ops->clone(dst, src);
-		if (err < 0)
-			return err;
-	} else {
-		memcpy(dst, src, src->ops->size);
-	}
-
-	__module_get(src->ops->type->owner);
-	return 0;
-}
-
 /**
  *	struct nft_rule - nf_tables rule
  *
diff --git a/net/netfilter/nft_dynset.c b/net/netfilter/nft_dynset.c
index e461007558e8..8394560aa695 100644
--- a/net/netfilter/nft_dynset.c
+++ b/net/netfilter/nft_dynset.c
@@ -28,6 +28,23 @@ struct nft_dynset {
 	struct nft_set_binding		binding;
 };
 
+static int nft_expr_clone(struct nft_expr *dst, struct nft_expr *src)
+{
+	int err;
+
+	if (src->ops->clone) {
+		dst->ops = src->ops;
+		err = src->ops->clone(dst, src);
+		if (err < 0)
+			return err;
+	} else {
+		memcpy(dst, src, src->ops->size);
+	}
+
+	__module_get(src->ops->type->owner);
+	return 0;
+}
+
 static void *nft_dynset_new(struct nft_set *set, const struct nft_expr *expr,
 			    struct nft_regs *regs)
 {
-- 
2.11.0


  reply	other threads:[~2019-05-05 23:33 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-05 23:32 [PATCH 00/12] Netfilter updates for net-next Pablo Neira Ayuso
2019-05-05 23:32 ` Pablo Neira Ayuso [this message]
2019-05-05 23:32 ` [PATCH 02/12] netfilter: nf_tables: fix implicit include of module.h Pablo Neira Ayuso
2019-05-05 23:32 ` [PATCH 03/12] netfilter: nf_tables: drop include of module.h from nf_tables.h Pablo Neira Ayuso
2019-05-05 23:32 ` [PATCH 04/12] netfilter: conntrack: limit sysctl setting for boolean options Pablo Neira Ayuso
2019-05-05 23:32 ` [PATCH 05/12] netfilter: use macros to create module aliases Pablo Neira Ayuso
2019-05-05 23:32 ` [PATCH 06/12] netfilter: add API to manage NAT helpers Pablo Neira Ayuso
2019-05-05 23:33 ` [PATCH 07/12] netfilter: nf_nat: register " Pablo Neira Ayuso
2019-05-05 23:33 ` [PATCH 08/12] openvswitch: load and reference the NAT helper Pablo Neira Ayuso
2019-05-05 23:33 ` [PATCH 09/12] netfilter: nft_ct: Add ct id support Pablo Neira Ayuso
2019-05-05 23:33 ` [PATCH 10/12] netfilter: connlabels: fix spelling mistake "trackling" -> "tracking" Pablo Neira Ayuso
2019-05-05 23:33 ` [PATCH 11/12] netfilter: xt_hashlimit: use struct_size() helper Pablo Neira Ayuso
2019-05-05 23:33 ` [PATCH 12/12] netfilter: slightly optimize nf_inet_addr_mask Pablo Neira Ayuso
2019-05-06  4:35 ` [PATCH 00/12] Netfilter updates for net-next 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=20190505233305.13650-2-pablo@netfilter.org \
    --to=pablo@netfilter.org \
    --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).