Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=45a19b0a725a04f3255d9d3da1fca30bb97f1481
Commit:     45a19b0a725a04f3255d9d3da1fca30bb97f1481
Parent:     d0127539ea9b5fcfe1a1d7d4d57f12384da5190c
Author:     Johann Felix Soden <[EMAIL PROTECTED]>
AuthorDate: Wed Nov 7 01:30:30 2007 -0800
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Wed Nov 7 04:15:02 2007 -0800

    [NETNS]: Fix compiler error in net_namespace.c
    
    Because net_free is called by copy_net_ns before its declaration, the
    compiler gives an error. This patch puts net_free before copy_net_ns
    to fix this.
    
    The compiler error:
    net/core/net_namespace.c: In function 'copy_net_ns':
    net/core/net_namespace.c:97: error: implicit declaration of function 
'net_free'
    net/core/net_namespace.c: At top level:
    net/core/net_namespace.c:104: warning: conflicting types for 'net_free'
    net/core/net_namespace.c:104: error: static declaration of 'net_free' 
follows non-static declaration
    net/core/net_namespace.c:97: error: previous implicit declaration of 
'net_free' was here
    
    The error was introduced by the '[NET]: Hide the dead code in the
    net_namespace.c' patch (6a1a3b9f686bb04820a232cc1657ef2c45670709).
    
    Signed-off-by: Johann Felix Soden <[EMAIL PROTECTED]>
    Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 net/core/net_namespace.c |   28 ++++++++++++++--------------
 1 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c
index e9f0964..3f6d37d 100644
--- a/net/core/net_namespace.c
+++ b/net/core/net_namespace.c
@@ -64,6 +64,20 @@ static struct net *net_alloc(void)
        return kmem_cache_zalloc(net_cachep, GFP_KERNEL);
 }
 
+static void net_free(struct net *net)
+{
+       if (!net)
+               return;
+
+       if (unlikely(atomic_read(&net->use_count) != 0)) {
+               printk(KERN_EMERG "network namespace not free! Usage: %d\n",
+                       atomic_read(&net->use_count));
+               return;
+       }
+
+       kmem_cache_free(net_cachep, net);
+}
+
 struct net *copy_net_ns(unsigned long flags, struct net *old_net)
 {
        struct net *new_net = NULL;
@@ -100,20 +114,6 @@ out:
        return new_net;
 }
 
-static void net_free(struct net *net)
-{
-       if (!net)
-               return;
-
-       if (unlikely(atomic_read(&net->use_count) != 0)) {
-               printk(KERN_EMERG "network namespace not free! Usage: %d\n",
-                       atomic_read(&net->use_count));
-               return;
-       }
-
-       kmem_cache_free(net_cachep, net);
-}
-
 static void cleanup_net(struct work_struct *work)
 {
        struct pernet_operations *ops;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to