All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Arend van Spriel <arend@broadcom.com>
Cc: "Luis R. Rodriguez" <mcgrof@kernel.org>, backports@vger.kernel.org
Subject: Re: [PATCH 2/2] backport: add backport file for the next kernel release
Date: Fri, 30 Jan 2015 21:21:49 +0100	[thread overview]
Message-ID: <1422649309.1919.42.camel@sipsolutions.net> (raw)
In-Reply-To: <1422648758-31361-2-git-send-email-arend@broadcom.com> (sfid-20150130_211248_858610_757440B4)

On Fri, 2015-01-30 at 21:12 +0100, Arend van Spriel wrote:

> --- /dev/null
> +++ b/backport/compat/backport-3.20.c
> @@ -0,0 +1,17 @@
> +/*
> + * Copyright (c) 2014  Hauke Mehrtens <hauke@hauke-m.de>

Speaking of copy/paste errors ... :)

> + * Backport functionality introduced in Linux 3.19.
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.
> + */
> +#include <linux/export.h>
> +#include <linux/net.h>
> +
> +struct net *get_net_ns_by_fd(int fd)
> +{
> +	return ERR_PTR(-EINVAL);
> +}
> +EXPORT_SYMBOL_GPL(get_net_ns_by_fd);

Interesting approach - you're relying on a previously existing
definition in some existing header file I guess? But does it always
exist?

I think it'd probably be better to have this in
backports-include/net/net_namespace.h, like so:

#define get_net_ns_by_fd LINUX_BACKPORT(get_net_ns_by_fd)
static inline struct net *get_net_ns_by_fd(int fd)
{
	return ERR_PTR(-EINVAL);
}

because that not only saves the huge EXPORT_SYMBOL thing (that's like a
few hundred bytes IIRC!) but also makes sure that the definition is
always really there?

Anyway as long as this was there on 3.0 already both approaches work, of
course.

johannes


  reply	other threads:[~2015-01-30 20:21 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-30 20:12 [PATCH 1/2] backport: small copy&paste error fixed Arend van Spriel
2015-01-30 20:12 ` [PATCH 2/2] backport: add backport file for the next kernel release Arend van Spriel
2015-01-30 20:21   ` Johannes Berg [this message]
2015-01-30 20:28     ` Arend van Spriel
2015-02-22  2:06 ` [PATCH 1/2] backport: small copy&paste error fixed Hauke Mehrtens
2015-02-22  7:36   ` Arend van Spriel

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=1422649309.1919.42.camel@sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=arend@broadcom.com \
    --cc=backports@vger.kernel.org \
    --cc=mcgrof@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.