patch-pre2.0.5 linux/include/linux/module.h

Next file: linux/include/linux/socket.h
Previous file: linux/include/linux/mcdx.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file pre2.0.4/linux/include/linux/module.h linux/include/linux/module.h
@@ -28,6 +28,7 @@
 
 /* magic marker for modules inserted from kerneld, to be auto-reaped */
 #define MOD_AUTOCLEAN 0x40000000 /* big enough, but no sign problems... */
+#define MOD_VISITED   0x20000000 /* Thanks Jacques! */
 
 /* maximum length of symbol name */
 #define SYM_MAX_NAME 60
@@ -88,9 +89,9 @@
 #ifdef MODULE
 
 extern long mod_use_count_;
-#define MOD_INC_USE_COUNT      mod_use_count_++
-#define MOD_DEC_USE_COUNT      mod_use_count_--
-#define MOD_IN_USE	       ((mod_use_count_ & ~MOD_AUTOCLEAN) != 0)
+#define MOD_INC_USE_COUNT      (mod_use_count_++, mod_use_count_ |= MOD_VISITED)
+#define MOD_DEC_USE_COUNT      (mod_use_count_--, mod_use_count_ |= MOD_VISITED)
+#define MOD_IN_USE	       ((mod_use_count_ & ~(MOD_AUTOCLEAN | MOD_VISITED)) != 0)
 
 #ifndef __NO_VERSION__
 #include <linux/version.h>

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov with Sam's (original) version
of this