+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
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
\
/* 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)) \
\
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); \
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);
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);
* 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;
}
#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;
#define DEBUG_SUBSYSTEM S_GENERIC
+char spl_version[16] = "SPL v" VERSION;
+
long spl_hostid = 0;
EXPORT_SYMBOL(spl_hostid);
#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 */
/* 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",