All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Remove MOD_* from LAPB
@ 2003-07-18 20:32 Stephen Hemminger
  2003-07-18 22:01 ` [PATCH] Allow lapb to be unloaded Stephen Hemminger
  2003-07-20  4:44 ` [PATCH] Remove MOD_* from LAPB David S. Miller
  0 siblings, 2 replies; 4+ messages in thread
From: Stephen Hemminger @ 2003-07-18 20:32 UTC (permalink / raw)
  To: Henner Eisen, David S. Miller; +Cc: netdev

The MOD_INC and MOD_DEC in lapb are no longer necessary in 2.6 since
the module subsystem will not allow lapb to be unloaded as long as a module
that is referencing the symbols (lapb_register/lapb_unregister) is loaded.

The lapb parameter block does have callback's so it is up to the caller
to correctly unregister on module exit; and looking at the existing code
it does do that.

Patch is against 2.6-test1

diff -Nru a/net/lapb/lapb_iface.c b/net/lapb/lapb_iface.c
--- a/net/lapb/lapb_iface.c	Fri Jul 18 13:21:02 2003
+++ b/net/lapb/lapb_iface.c	Fri Jul 18 13:21:02 2003
@@ -43,13 +43,11 @@
 static rwlock_t lapb_list_lock = RW_LOCK_UNLOCKED;
 
 /*
- *	Free an allocated lapb control block. This is done to centralise
- *	the MOD count code.
+ *	Free an allocated lapb control block. 
  */
 static void lapb_free_cb(struct lapb_cb *lapb)
 {
 	kfree(lapb);
-	MOD_DEC_USE_COUNT;
 }
 
 static __inline__ void lapb_hold(struct lapb_cb *lapb)
@@ -126,8 +124,6 @@
 
 	if (!lapb)
 		goto out;
-
-	MOD_INC_USE_COUNT;
 
 	memset(lapb, 0x00, sizeof(*lapb));
 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] Allow lapb to be unloaded.
  2003-07-18 20:32 [PATCH] Remove MOD_* from LAPB Stephen Hemminger
@ 2003-07-18 22:01 ` Stephen Hemminger
  2003-07-20  4:47   ` David S. Miller
  2003-07-20  4:44 ` [PATCH] Remove MOD_* from LAPB David S. Miller
  1 sibling, 1 reply; 4+ messages in thread
From: Stephen Hemminger @ 2003-07-18 22:01 UTC (permalink / raw)
  To: Henner Eisen, David S. Miller; +Cc: netdev

Without an exit routine lapb can't be unloaded.

Tested on 2.6.0-test1
diff -Nru a/net/lapb/lapb_iface.c b/net/lapb/lapb_iface.c
--- a/net/lapb/lapb_iface.c	Fri Jul 18 14:52:18 2003
+++ b/net/lapb/lapb_iface.c	Fri Jul 18 14:52:18 2003
@@ -443,8 +443,14 @@
 	return 0;
 }
 
+static void __exit lapb_exit(void)
+{
+	WARN_ON(!list_empty(&lapb_list));
+}
+
 MODULE_AUTHOR("Jonathan Naylor <g4klx@g4klx.demon.co.uk>");
 MODULE_DESCRIPTION("The X.25 Link Access Procedure B link layer protocol");
 MODULE_LICENSE("GPL");
 
 module_init(lapb_init);
+module_exit(lapb_exit);

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Remove MOD_* from LAPB
  2003-07-18 20:32 [PATCH] Remove MOD_* from LAPB Stephen Hemminger
  2003-07-18 22:01 ` [PATCH] Allow lapb to be unloaded Stephen Hemminger
@ 2003-07-20  4:44 ` David S. Miller
  1 sibling, 0 replies; 4+ messages in thread
From: David S. Miller @ 2003-07-20  4:44 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: eis, netdev

On Fri, 18 Jul 2003 13:32:11 -0700
Stephen Hemminger <shemminger@osdl.org> wrote:

> The MOD_INC and MOD_DEC in lapb are no longer necessary in 2.6 since
> the module subsystem will not allow lapb to be unloaded as long as a module
> that is referencing the symbols (lapb_register/lapb_unregister) is loaded.
> 
> The lapb parameter block does have callback's so it is up to the caller
> to correctly unregister on module exit; and looking at the existing code
> it does do that.

Applied, thanks.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Allow lapb to be unloaded.
  2003-07-18 22:01 ` [PATCH] Allow lapb to be unloaded Stephen Hemminger
@ 2003-07-20  4:47   ` David S. Miller
  0 siblings, 0 replies; 4+ messages in thread
From: David S. Miller @ 2003-07-20  4:47 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: eis, netdev

On Fri, 18 Jul 2003 15:01:01 -0700
Stephen Hemminger <shemminger@osdl.org> wrote:

> Without an exit routine lapb can't be unloaded.

Applied, thanks.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2003-07-20  4:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-07-18 20:32 [PATCH] Remove MOD_* from LAPB Stephen Hemminger
2003-07-18 22:01 ` [PATCH] Allow lapb to be unloaded Stephen Hemminger
2003-07-20  4:47   ` David S. Miller
2003-07-20  4:44 ` [PATCH] Remove MOD_* from LAPB David S. Miller

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.