Thread (7 messages) 7 messages, 3 authors, 2015-12-15

Re: [PATCH v5 net-next 4/4] ila: Add generic ILA translation facility

From: Florian Westphal <fw@strlen.de>
Date: 2015-12-15 07:07:04

Tom Herbert [off-list ref] wrote:
+static int ila_add_mapping(struct net *net, struct ila_xlat_params *p)
+{
+	struct ila_net *ilan = net_generic(net, ila_net_id);
+	struct ila_map *ila, *head;
+	spinlock_t *lock = ila_get_lock(ilan, p->identifier);
+	int err = 0, order;
+
+	if (!ilan->hooks_registered) {
+		/* We defer registering net hooks in the namespace until the
+		 * first mapping is added.
+		 */
+		err = nf_register_net_hooks(net, ila_nf_hook_ops,
+					    ARRAY_SIZE(ila_nf_hook_ops));
+		if (err)
+			return err;
Looks as if this misses a
		ilan->hooks_registered = true
+	}
+
+	ila = kzalloc(sizeof(*ila), GFP_KERNEL);
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help