From: Matt Mackall <mpm@selenic.com>

Add vprintk call.  This lets us directly pass varargs stuff to the console
without using vsnprintf to an intermediate buffer.

Signed-off-by: Matt Mackall <mpm@selenic.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 25-akpm/include/linux/kernel.h |    1 +
 25-akpm/kernel/printk.c        |   14 ++++++++++++--
 2 files changed, 13 insertions(+), 2 deletions(-)

diff -puN include/linux/kernel.h~vprintk-support include/linux/kernel.h
--- 25/include/linux/kernel.h~vprintk-support	2004-07-31 17:12:50.846842016 -0700
+++ 25-akpm/include/linux/kernel.h	2004-07-31 17:12:50.852841104 -0700
@@ -97,6 +97,7 @@ extern int __kernel_text_address(unsigne
 extern int kernel_text_address(unsigned long addr);
 extern int session_of_pgrp(int pgrp);
 
+asmlinkage int vprintk(const char *fmt, va_list args);
 asmlinkage int printk(const char * fmt, ...)
 	__attribute__ ((format (printf, 1, 2)));
 
diff -puN kernel/printk.c~vprintk-support kernel/printk.c
--- 25/kernel/printk.c~vprintk-support	2004-07-31 17:12:50.848841712 -0700
+++ 25-akpm/kernel/printk.c	2004-07-31 17:12:50.853840952 -0700
@@ -508,6 +508,17 @@ static void zap_locks(void)
 asmlinkage int printk(const char *fmt, ...)
 {
 	va_list args;
+	int r;
+
+	va_start(args, fmt);
+	r = vprintk(fmt, args);
+	va_end(args);
+
+	return r;
+}
+
+asmlinkage int vprintk(const char *fmt, va_list args)
+{
 	unsigned long flags;
 	int printed_len;
 	char *p;
@@ -521,9 +532,7 @@ asmlinkage int printk(const char *fmt, .
 	spin_lock_irqsave(&logbuf_lock, flags);
 
 	/* Emit the output into the temporary buffer */
-	va_start(args, fmt);
 	printed_len = vscnprintf(printk_buf, sizeof(printk_buf), fmt, args);
-	va_end(args);
 
 	/*
 	 * Copy the output into log_buf.  If the caller didn't provide
@@ -575,6 +584,7 @@ out:
 	return printed_len;
 }
 EXPORT_SYMBOL(printk);
+EXPORT_SYMBOL(vprintk);
 
 /**
  * acquire_console_sem - lock the console system for exclusive use.
_