netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Graf <tgraf@suug.ch>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, Thomas Graf <tgraf@suug.ch>
Subject: [PATCH 1/3] [GENL]: Add genlmsg_new() to allocate generic netlink messages
Date: Tue, 14 Nov 2006 12:46:29 +0100	[thread overview]
Message-ID: <20061114114657.681000534@lsx.localdomain> (raw)
In-Reply-To: 20061114114628.033840590@lsx.localdomain

[-- Attachment #1: genlmsg_new --]
[-- Type: text/plain, Size: 1191 bytes --]

Signed-off-by: Thomas Graf <tgraf@suug.ch>

Index: net-2.6.20/include/net/genetlink.h
===================================================================
--- net-2.6.20.orig/include/net/genetlink.h	2006-11-14 11:52:29.000000000 +0100
+++ net-2.6.20/include/net/genetlink.h	2006-11-14 12:23:56.000000000 +0100
@@ -187,4 +187,15 @@
 	return NLMSG_ALIGN(genlmsg_msg_size(payload));
 }
 
+/**
+ * genlmsg_new - Allocate a new generic netlink message
+ * @payload: size of the message payload
+ * @flags: the type of memory to allocate.
+ */
+static inline struct sk_buff *genlmsg_new(size_t payload, gfp_t flags)
+{
+	return nlmsg_new(genlmsg_total_size(payload), flags);
+}
+
+
 #endif	/* __NET_GENERIC_NETLINK_H */
Index: net-2.6.20/kernel/taskstats.c
===================================================================
--- net-2.6.20.orig/kernel/taskstats.c	2006-11-14 11:53:44.000000000 +0100
+++ net-2.6.20/kernel/taskstats.c	2006-11-14 12:23:18.000000000 +0100
@@ -77,7 +77,7 @@
 	/*
 	 * If new attributes are added, please revisit this allocation
 	 */
-	skb = nlmsg_new(genlmsg_total_size(size), GFP_KERNEL);
+	skb = genlmsg_new(size, GFP_KERNEL);
 	if (!skb)
 		return -ENOMEM;
 

--


  reply	other threads:[~2006-11-14 11:48 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-14 11:46 Generic Netlink Updates Thomas Graf
2006-11-14 11:46 ` Thomas Graf [this message]
2006-11-14 11:46 ` [PATCH 2/3] [GENL]: Add genlmsg_reply() to simply unicast replies to requests Thomas Graf
2006-11-14 11:46 ` [PATCH 3/3] [GENL]: Add genlmsg_put_reply() to simplify building reply headers Thomas Graf
2006-11-14 17:23 ` Generic Netlink Updates Paul Moore
2006-11-15  3:46   ` 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=20061114114657.681000534@lsx.localdomain \
    --to=tgraf@suug.ch \
    --cc=davem@davemloft.net \
    --cc=netdev@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).