summaryrefslogtreecommitdiffstats
path: root/runtime/procfs.c
diff options
context:
space:
mode:
authorddomingo <ddomingo@redhat.com>2008-10-06 16:19:08 +1000
committerddomingo <ddomingo@redhat.com>2008-10-06 16:19:08 +1000
commit56bf4a62d293f8a353a63833cf945024d1d77ae8 (patch)
tree66d37792213c0e3b7cf5d6a11cdc3800c45bac87 /runtime/procfs.c
parentd77fecabffb83a90c7ef7b6ad81a183beb345330 (diff)
parent5311c037f83f66967f9de4cc66815f93940bb005 (diff)
downloadsystemtap-steved-56bf4a62d293f8a353a63833cf945024d1d77ae8.tar.gz
systemtap-steved-56bf4a62d293f8a353a63833cf945024d1d77ae8.tar.xz
systemtap-steved-56bf4a62d293f8a353a63833cf945024d1d77ae8.zip
Merge branch 'master' of ssh://sources.redhat.com/git/systemtap
Diffstat (limited to 'runtime/procfs.c')
-rw-r--r--runtime/procfs.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/runtime/procfs.c b/runtime/procfs.c
index 1b1d5447..0fe22aba 100644
--- a/runtime/procfs.c
+++ b/runtime/procfs.c
@@ -24,13 +24,20 @@ static struct proc_dir_entry *_stp_proc_root = NULL;
void _stp_close_procfs(void);
+// 2.6.24 fixed proc_dir_entry refcounting.
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24)
+#define LAST_ENTRY_COUNT 0
+#else
+#define LAST_ENTRY_COUNT 1
+#endif
+
/*
* Removes /proc/systemtap/{module_name} and /proc/systemtap (if empty)
*/
void _stp_rmdir_proc_module(void)
{
if (_stp_proc_root && _stp_proc_root->subdir == NULL) {
- if (atomic_read(&_stp_proc_root->count))
+ if (atomic_read(&_stp_proc_root->count) != LAST_ENTRY_COUNT)
_stp_warn("Removal of /proc/systemtap/%s\nis deferred until it is no longer in use.\n"
"Systemtap module removal will block.\n", THIS_MODULE->name);
remove_proc_entry(THIS_MODULE->name, _stp_proc_stap);