All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arend van Spriel <arend@broadcom.com>
To: Johannes Berg <johannes@sipsolutions.net>
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:28:22 +0100	[thread overview]
Message-ID: <54CBE966.7030600@broadcom.com> (raw)
In-Reply-To: <1422649309.1919.42.camel@sipsolutions.net>

On 01/30/15 21:21, Johannes Berg wrote:
> 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 ... :)

Hah! :-D Will fix that and the year.

>> + * Backport functionality introduced in Linux 3.19.

And this one.

>> + *
>> + * 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);
> }

This was indeed the trick that I was looking for.

> 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?

Is that a question? Guess not. I will make a V2.

Regards,
Arend

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

  reply	other threads:[~2015-01-30 20:28 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
2015-01-30 20:28     ` Arend van Spriel [this message]
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=54CBE966.7030600@broadcom.com \
    --to=arend@broadcom.com \
    --cc=backports@vger.kernel.org \
    --cc=johannes@sipsolutions.net \
    --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.