 include/linux/dyn_pageflags.h |    7 -------
 lib/vsprintf.c                |   28 ++++++++++++++++++++++++++++
 2 files changed, 28 insertions(+), 7 deletions(-)
diff -ruNp 810-snprintf-used.patch-old/lib/vsprintf.c 810-snprintf-used.patch-new/lib/vsprintf.c
--- 810-snprintf-used.patch-old/lib/vsprintf.c	2005-06-20 11:47:32.000000000 +1000
+++ 810-snprintf-used.patch-new/lib/vsprintf.c	2005-07-20 08:52:31.000000000 +1000
@@ -235,6 +235,34 @@ static char * number(char * buf, char * 
 	return buf;
 }
 
+/*
+ * vsnprintf_used
+ *
+ * Functionality    : Print a string with parameters to a buffer of a 
+ *                    limited size. Unlike vsnprintf, we return the number
+ *                    of bytes actually put in the buffer, not the number
+ *                    that would have been put in if it was big enough.
+ */
+int snprintf_used(char * buffer, int buffer_size, const char *fmt, ...)
+{
+	int result;
+	va_list args;
+
+	if (!buffer_size) {
+		return 0;
+	}
+
+	va_start(args, fmt);
+	result = vsnprintf(buffer, buffer_size, fmt, args);
+	va_end(args);
+
+	if (result > buffer_size) {
+		return buffer_size;
+	}
+
+	return result;
+}
+
 /**
  * vsnprintf - Format a string and place it in a buffer
  * @buf: The buffer to place the result into

