netdev
[Top] [All Lists]

[PATCH] ipx: remove MOD_{INC,DEC}_USE_COUNT

To: "David S. Miller" <davem@xxxxxxxxxx>
Subject: [PATCH] ipx: remove MOD_{INC,DEC}_USE_COUNT
From: Arnaldo Carvalho de Melo <acme@xxxxxxxxxxxxxxxx>
Date: Sun, 27 Apr 2003 12:03:02 -0300
Cc: Linux Networking Development Mailing List <netdev@xxxxxxxxxxx>
Organization: Conectiva S.A.
Sender: netdev-bounce@xxxxxxxxxxx
User-agent: Mutt/1.5.4i
Hi David,

        Please pull from:

bk://kernel.bkbits.net/acme/net-2.5

        Now there are two outstanding changesets in this tree.

- Arnaldo

You can import this changeset into BK by piping this whole message to:
'| bk receive [path to repository]' or apply the patch as usual.

===================================================================


ChangeSet@xxxxxx, 2003-04-27 11:03:43-03:00, acme@xxxxxxxxxxxxxxxx
  o ipx: remove MOD_{INC,DEC}_USE_COUNT
  
  Now the core networking infrastructure will (finally) do that for the net 
protocol
  families, its just a matter of setting the ->owner field in the registered 
struct
  net_proto_family to THIS_MODULE.


 af_ipx.c |   28 ++++------------------------
 1 files changed, 4 insertions(+), 24 deletions(-)


diff -Nru a/net/ipx/af_ipx.c b/net/ipx/af_ipx.c
--- a/net/ipx/af_ipx.c  Sun Apr 27 11:56:18 2003
+++ b/net/ipx/af_ipx.c  Sun Apr 27 11:56:18 2003
@@ -95,18 +95,6 @@
 atomic_t ipx_sock_nr;
 #endif
 
-static void ipxcfg_set_auto_create(char val)
-{
-       if (ipxcfg_auto_create_interfaces != val) {
-               if (val)
-                       MOD_INC_USE_COUNT;
-               else
-                       MOD_DEC_USE_COUNT;
-
-               ipxcfg_auto_create_interfaces = val;
-       }
-}
-
 static void ipxcfg_set_auto_select(char val)
 {
        ipxcfg_auto_select_primary = val;
@@ -373,7 +361,6 @@
        if (intrfc->if_dev)
                dev_put(intrfc->if_dev);
        kfree(intrfc);
-       MOD_DEC_USE_COUNT;
 }
 
 static void ipxitf_down(struct ipx_interface *intrfc)
@@ -949,7 +936,6 @@
                intrfc->if_sklist       = NULL;
                atomic_set(&intrfc->refcnt, 1);
                spin_lock_init(&intrfc->if_sklist_lock);
-               MOD_INC_USE_COUNT;
        }
 
        return intrfc;
@@ -1272,7 +1258,7 @@
                case SIOCAIPXITFCRT: 
                        if (get_user(val, (unsigned char *) arg))
                                return -EFAULT;
-                       ipxcfg_set_auto_create(val);
+                       ipxcfg_auto_create_interfaces = val;
                        break;
 
                case SIOCAIPXPRISLT: 
@@ -1690,13 +1676,12 @@
        struct ipx_opt *ipx = NULL;
        struct sock *sk;
 
-       MOD_INC_USE_COUNT;
        switch (sock->type) {
                case SOCK_DGRAM:
                        sk = sk_alloc(PF_IPX, GFP_KERNEL, 1, NULL);
                        ret = -ENOMEM;
                        if (!sk)
-                               goto decmod;
+                               goto out;
                        ipx = ipx_sk(sk) = kmalloc(sizeof(*ipx), GFP_KERNEL);
                        if (!ipx)
                                goto outsk;
@@ -1713,7 +1698,7 @@
                         */
                case SOCK_STREAM:       /* Allow higher levels to piggyback */
                default:
-                       goto decmod;
+                       goto out;
        }
 #ifdef IPX_REFCNT_DEBUG
         atomic_inc(&ipx_sock_nr);
@@ -1727,8 +1712,6 @@
        return ret;
 outsk:
        sk_free(sk);
-decmod:
-       MOD_DEC_USE_COUNT;
        goto out;
 }
 
@@ -1745,10 +1728,6 @@
        __set_bit(SOCK_DEAD, &sk->flags);
        sock->sk = NULL;
        ipx_destroy_socket(sk);
-
-       if (sock->type == SOCK_DGRAM)
-               MOD_DEC_USE_COUNT;
-
 out:
        return 0;
 }
@@ -2252,6 +2231,7 @@
 static struct net_proto_family ipx_family_ops = {
        .family         = PF_IPX,
        .create         = ipx_create,
+       .owner          = THIS_MODULE,
 };
 
 static struct proto_ops SOCKOPS_WRAPPED(ipx_dgram_ops) = {

===================================================================


This BitKeeper patch contains the following changesets:
1.1124
## Wrapped with gzip_uu ##


M'XL( )+OJSX  ^U5VT[;0!!]]G[%2+RT*G'VYENJ(-HD*A$4$)!G:W'6B8OM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