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

From: Arnaldo Carvalho de Melo <[email-masked]>
Date: Sun, 27 Apr 2003 12:03:02 -0300

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.

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

[email-masked], 2003-04-27 11:03:43-03:00, [email-masked]
  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 ##

CN=U1.L[P\<'L/_QFDJ5.;NI5,?2BB&J=2O(#7'#HQ,$&