#define KMC_DEFAULT_SEEKS 1
extern int kmem_debugging(void);
+extern char *kmem_vasprintf(const char *fmt, va_list ap);
extern char *kmem_asprintf(const char *fmt, ...);
#define strfree(str) kfree(str)
#define strdup(str) kstrdup(str, GFP_KERNEL)
EXPORT_SYMBOL(kvasprintf);
#endif /* HAVE_KVASPRINTF */
+char *
+kmem_vasprintf(const char *fmt, va_list ap)
+{
+ va_list aq;
+ char *ptr;
+
+ va_copy(aq, ap);
+ do {
+ ptr = kvasprintf(GFP_KERNEL, fmt, aq);
+ } while (ptr == NULL);
+ va_end(aq);
+
+ return ptr;
+}
+EXPORT_SYMBOL(kmem_vasprintf);
+
char *
kmem_asprintf(const char *fmt, ...)
{
- va_list args;
+ va_list ap;
char *ptr;
- va_start(args, fmt);
+ va_start(ap, fmt);
do {
- ptr = kvasprintf(GFP_KERNEL, fmt, args);
+ ptr = kvasprintf(GFP_KERNEL, fmt, ap);
} while (ptr == NULL);
- va_end(args);
+ va_end(ap);
return ptr;
}