--- Jose Luis Alarcon <jlalarcon@tiggerfan.com> wrote: >--- John Levon <levon@movementarian.org> wrote: >>On Sun, Dec 08, 2002 at 12:51:43PM -0800, Jose Luis Alarcon wrote: >> >>> I has a big surprise when, adding at the beginning of init_module() >>> the macro MOD_INC_USE_COUNT, for have a module use counter. My program >>> get compile well and insmod work too. >>> >>> But the surprise was when i did rmmod, cos the output said: >>> >>> FATAL: the module is in use >> >>Why are you surprised ? You marked the module as used by something when >>you load it, of course it can't be unloaded. >> > > Jonh: first, thank you very much for answer my question. > > I am surprised cos if the line MOD_INC_USE_COUNT; is commented, then >the lsmod command say that the module is used by 0 (unused, i think) and >the rmmod command uninstall the module without nothing to say. > >>> I did lsmod, and i got that my module was used by [unsafe]. >> >>You should not be using MOD_INC_USE_COUNT in 2.5 kernels. And you >>definitely shouldn't be doing it in init_module(), that makes no sense. >> > > Can you explain, please, why the macro have no sense in init_module()?, maybe >(i am thinking about it) use this counter make no sense in any place at the >module, but i am learning and i only want to see it working. > >>What do you actually believe MOD_INC_USE_COUNT does ? >> > > I was reading that create a counter that count the number of times that the >module is used, is it right? > >>regards >>john >> > > Thank you, Jonh, again. > > Regards. > > Jose. > One more thing about this: I put 'MOD_INC_USE_COUNT;' like the last line just before the key (}) that ends the cleanup_module() void function....and the program load with insmod and unload with rmmod without problems. lsmod tells that the module is used by 0 (unused). All this with the 2.5.49 kernel. Maybe was a problem of the "situation" of the line....... Regards. Jose. Debian GNU/Linux 'Sid' Kernel 2.4.19 Ext3. ESware Linux 365 Kernel 2.5.49 ReiserFS. Registered Linux User #213309. Memories..... You are talking about memories. Rick Deckard. Blade Runner. _____________________________________________________________ Get your own free tiggerfan.com email address!! DisneySites!! - http://www.disneysites.com/webmail/tiggerfan _____________________________________________________________ Select your own custom email address for FREE! Get you@yourchoice.com w/No Ads, 6MB, POP & more! http://www.everyone.net/selectmail?campaign=tag -- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/