* It is also used in interesting ways to provide interlocking in
* release_console_sem().
*/
-static spinlock_t logbuf_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(logbuf_lock);
static char __log_buf[__LOG_BUF_LEN];
static char *log_buf = __log_buf;
error = __put_user(c,buf);
buf++;
i++;
+ cond_resched();
spin_lock_irq(&logbuf_lock);
}
spin_unlock_irq(&logbuf_lock);
c = LOG_BUF(j);
spin_unlock_irq(&logbuf_lock);
error = __put_user(c,&buf[count-1-i]);
+ cond_resched();
spin_lock_irq(&logbuf_lock);
}
spin_unlock_irq(&logbuf_lock);
error = -EFAULT;
break;
}
+ cond_resched();
}
}
break;
return error;
}
-#ifdef CONFIG_KDB
-/* kdb dmesg command needs access to the syslog buffer. do_syslog() uses locks
- * so it cannot be used during debugging. Just tell kdb where the start and
- * end of the physical and logical logs are. This is equivalent to do_syslog(3).
- */
-void kdb_syslog_data(char *syslog_data[4])
-{
- syslog_data[0] = log_buf;
- syslog_data[1] = log_buf + log_buf_len;
- syslog_data[2] = log_buf + log_end - (logged_chars < log_buf_len ? logged_chars : log_buf_len);
- syslog_data[3] = log_buf + log_end;
-}
-#endif /* CONFIG_KDB */
-
asmlinkage long sys_syslog(int type, char __user * buf, int len)
{
return do_syslog(type, buf, len);
_con_start = con_start;
_log_end = log_end;
con_start = log_end; /* Flush */
- spin_unlock_irqrestore(&logbuf_lock, flags);
+ spin_unlock(&logbuf_lock);
call_console_drivers(_con_start, _log_end);
+ local_irq_restore(flags);
}
console_locked = 0;
console_may_schedule = 0;
*/
int __printk_ratelimit(int ratelimit_jiffies, int ratelimit_burst)
{
- static spinlock_t ratelimit_lock = SPIN_LOCK_UNLOCKED;
+ static DEFINE_SPINLOCK(ratelimit_lock);
static unsigned long toks = 10*5*HZ;
static unsigned long last_msg;
static int missed;