summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorbehlendo <behlendo@7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c>2008-04-24 17:41:23 +0000
committerbehlendo <behlendo@7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c>2008-04-24 17:41:23 +0000
commit3561541c244da5ff6b0ded99a22bd1541bdb2a11 (patch)
tree4ff6216ba29ab1d72e45f2d88f66c839a9d7799b /include
parent1bac409fa3a7c0b4e09e43776ac063ef50efcfd6 (diff)
Prep for 0.2.1 tag
Minor fixes to headers to use debug macros Added /proc/sys/spl/version git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@90 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c
Diffstat (limited to 'include')
-rw-r--r--include/sys/kmem.h37
-rw-r--r--include/sys/mutex.h14
-rw-r--r--include/sys/rwlock.h1
-rw-r--r--include/sys/sysmacros.h1
4 files changed, 31 insertions, 22 deletions
diff --git a/include/sys/kmem.h b/include/sys/kmem.h
index a02bdcbff..c355fdc3c 100644
--- a/include/sys/kmem.h
+++ b/include/sys/kmem.h
@@ -36,17 +36,21 @@ extern int kmem_warning_flag;
\
/* Marked unlikely because we should never be doing this */ \
if (unlikely((size) > (PAGE_SIZE * 4)) && kmem_warning_flag) \
- printk("spl: Warning kmem_alloc(%d, 0x%x) large alloc at %s:%d "\
- "(%ld/%ld)\n", (int)(size), (int)(flags), \
- __FILE__, __LINE__, \
- atomic64_read(&kmem_alloc_used), kmem_alloc_max); \
+ __CDEBUG_LIMIT(S_KMEM, D_WARNING, "Warning " \
+ "kmem_alloc(%d, 0x%x) large alloc at %s:%d " \
+ "(%ld/%ld)\n", (int)(size), (int)(flags), \
+ __FILE__, __LINE__, \
+ atomic64_read(&kmem_alloc_used), \
+ kmem_alloc_max); \
\
_ptr_ = (void *)allocator((size), (flags)); \
if (_ptr_ == NULL) { \
- printk("spl: Warning kmem_alloc(%d, 0x%x) failed at %s:%d " \
- "(%ld/%ld)\n", (int)(size), (int)(flags), \
- __FILE__, __LINE__, \
- atomic64_read(&kmem_alloc_used), kmem_alloc_max); \
+ __CDEBUG_LIMIT(S_KMEM, D_WARNING, "Warning " \
+ "kmem_alloc(%d, 0x%x) failed at %s:%d " \
+ "(%ld/%ld)\n", (int)(size), (int)(flags), \
+ __FILE__, __LINE__, \
+ atomic64_read(&kmem_alloc_used), \
+ kmem_alloc_max); \
} else { \
atomic64_add((size), &kmem_alloc_used); \
if (unlikely(atomic64_read(&kmem_alloc_used)>kmem_alloc_max)) \
@@ -72,17 +76,20 @@ extern int kmem_warning_flag;
\
ASSERT(flags & KM_SLEEP); \
\
- _ptr_ = (void *)__vmalloc((size), (((flags) | \
- __GFP_HIGHMEM) & \
- ~__GFP_ZERO), PAGE_KERNEL); \
+ _ptr_ = (void *)__vmalloc((size), \
+ (((flags) | __GFP_HIGHMEM) & ~__GFP_ZERO), \
+ PAGE_KERNEL); \
if (_ptr_ == NULL) { \
- printk("spl: Warning vmem_alloc(%d, 0x%x) failed at %s:%d " \
- "(%ld/%ld)\n", (int)(size), (int)(flags), \
- __FILE__, __LINE__, \
- atomic64_read(&vmem_alloc_used), vmem_alloc_max); \
+ __CDEBUG_LIMIT(S_KMEM, D_WARNING, "Warning " \
+ "vmem_alloc(%d, 0x%x) failed at %s:%d " \
+ "(%ld/%ld)\n", (int)(size), (int)(flags), \
+ __FILE__, __LINE__, \
+ atomic64_read(&vmem_alloc_used), \
+ vmem_alloc_max); \
} else { \
if (flags & __GFP_ZERO) \
memset(_ptr_, 0, (size)); \
+ \
atomic64_add((size), &vmem_alloc_used); \
if (unlikely(atomic64_read(&vmem_alloc_used)>vmem_alloc_max)) \
vmem_alloc_max = atomic64_read(&vmem_alloc_used); \
diff --git a/include/sys/mutex.h b/include/sys/mutex.h
index 1f99c4d0d..d7036b566 100644
--- a/include/sys/mutex.h
+++ b/include/sys/mutex.h
@@ -76,10 +76,11 @@ mutex_enter(kmutex_t *mp)
spin_lock(&mp->km_lock);
if (unlikely(in_atomic() && !current->exit_state)) {
- printk("May schedule while atomic: %s/0x%08x/%d\n",
- current->comm, preempt_count(), current->pid);
spin_unlock(&mp->km_lock);
- BUG();
+ __CDEBUG_LIMIT(S_MUTEX, D_ERROR,
+ "May schedule while atomic: %s/0x%08x/%d\n",
+ current->comm, preempt_count(), current->pid);
+ SBUG();
}
spin_unlock(&mp->km_lock);
@@ -103,10 +104,11 @@ mutex_tryenter(kmutex_t *mp)
spin_lock(&mp->km_lock);
if (unlikely(in_atomic() && !current->exit_state)) {
- printk("May schedule while atomic: %s/0x%08x/%d\n",
- current->comm, preempt_count(), current->pid);
spin_unlock(&mp->km_lock);
- BUG();
+ __CDEBUG_LIMIT(S_MUTEX, D_ERROR,
+ "May schedule while atomic: %s/0x%08x/%d\n",
+ current->comm, preempt_count(), current->pid);
+ SBUG();
}
spin_unlock(&mp->km_lock);
diff --git a/include/sys/rwlock.h b/include/sys/rwlock.h
index 8fd34e9c6..cd6e46081 100644
--- a/include/sys/rwlock.h
+++ b/include/sys/rwlock.h
@@ -250,7 +250,6 @@ rw_tryupgrade(krwlock_t *rwlp)
* lock. If there is, then we know we should
* not try to upgrade the lock */
if (!list_empty(&rwlp->rw_sem.wait_list)) {
- printk("spl: Warning There are threads waiting\n");
spin_unlock(&rwlp->rw_sem.wait_lock);
return 0;
}
diff --git a/include/sys/sysmacros.h b/include/sys/sysmacros.h
index 0cafd7122..6f19f5a3e 100644
--- a/include/sys/sysmacros.h
+++ b/include/sys/sysmacros.h
@@ -98,6 +98,7 @@ extern "C" {
#define DTRACE_PROBE4(a, b, c, d, e, f, g, h, i) ((void)0)
/* Missing globals */
+extern char spl_version[16];
extern long spl_hostid;
extern char hw_serial[11];
extern int p0;