]> granicus.if.org Git - zfs/commitdiff
Prep for 0.2.1 tag
authorbehlendo <behlendo@7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c>
Thu, 24 Apr 2008 17:41:23 +0000 (17:41 +0000)
committerbehlendo <behlendo@7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c>
Thu, 24 Apr 2008 17:41:23 +0000 (17:41 +0000)
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

ChangeLog
configure.ac
include/sys/kmem.h
include/sys/mutex.h
include/sys/rwlock.h
include/sys/sysmacros.h
modules/spl/spl-generic.c
modules/spl/spl-proc.c

index e00188f63a98e68c4b599d421b3ed551529d2e8d..0106bbd5e13acdc671566fea381c0f2059785ef7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2008-04-24 Brian Behlendorf <behlendorf1@llnl.gov>
+
+       * : Tag spl-0.2.1 
+
+       * modules/spl/spl-proc.c : Add /proc/sys/spl/version.
+
 2008-04-24 Herb Wartens <wartens2@llnl.gov>
 
        * include/sys/kmem.h : Make sure that when calling __vmem_alloc
index 6502dcec069c88753838e3f1eda9ffdcd46a9973..be8271b6b4a9c6b1b1227f146bfcf71576c1422f 100644 (file)
@@ -1,7 +1,7 @@
 AC_INIT
 
 AC_CANONICAL_SYSTEM
-AM_INIT_AUTOMAKE(spl, 0.2.0)
+AM_INIT_AUTOMAKE(spl, 0.2.1)
 AC_CONFIG_HEADERS([config.h])
 
 AC_PROG_INSTALL
index a02bdcbffe716b88ae32880bc57c22d36396f802..c355fdc3c9fa7639f85802feff1720ccc53889bb 100644 (file)
@@ -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);     \
index 1f99c4d0d444a3ed721170411be3aa1fdaa80941..d7036b566526dfc6b6d588ff2a4cd35c429f34ea 100644 (file)
@@ -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);
index 8fd34e9c66229ce9da648ec5a9bed4969999294f..cd6e46081b71ffa7bc5b8fed2a560968661234c6 100644 (file)
@@ -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;
        }
index 0cafd71220b22e68c6fccd3fc9b4055dc435a716..6f19f5a3e643298096e56d6ca0dcaa6e29678c02 100644 (file)
@@ -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;
index be244cd7a598268a96728b197d5cd4ea83900690..1aadb990e633b807aa3a5219e1fec7c2b8d9d2d7 100644 (file)
@@ -13,6 +13,8 @@
 
 #define DEBUG_SUBSYSTEM S_GENERIC
 
+char spl_version[16] = "SPL v" VERSION;
+
 long spl_hostid = 0;
 EXPORT_SYMBOL(spl_hostid);
 
index 1f97b366723143f3b2a6702a038e555917745f41..94dd937a16e5c40dd281d34dd9305d0f6a1b413e 100644 (file)
@@ -20,7 +20,8 @@ static unsigned long table_max = ~0;
 
 #define CTL_SPL 0x87
 enum {
-        CTL_DEBUG_SUBSYS = 1,     /* Debug subsystem */
+       CTL_VERSION = 1,          /* Version */
+        CTL_DEBUG_SUBSYS,         /* Debug subsystem */
         CTL_DEBUG_MASK,           /* Debug mask */
         CTL_DEBUG_PRINTK,         /* Force all messages to console */
         CTL_DEBUG_MB,             /* Debug buffer size */
@@ -371,6 +372,14 @@ static struct ctl_table spl_table[] = {
         /* NB No .strategy entries have been provided since
          * sysctl(8) prefers to go via /proc for portability.
          */
+        {
+                .ctl_name = CTL_VERSION,
+                .procname = "version",
+                .data     = spl_version,
+                .maxlen   = sizeof(spl_version),
+                .mode     = 0444,
+                .proc_handler = &proc_dostring,
+        },
         {
                 .ctl_name = CTL_DEBUG_SUBSYS,
                 .procname = "debug_subsystem",