mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2024-12-26 03:09:34 +03:00
Remove kvasprintf() wrapper
The kvasprintf() function has been available since Linux 2.6.22. There is no longer a need to maintain this compatibility code. Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
This commit is contained in:
parent
0fac9c9e6d
commit
3d5392cefa
@ -37,7 +37,6 @@ AC_DEFUN([SPL_AC_CONFIG_KERNEL], [
|
||||
SPL_AC_FS_STRUCT_SPINLOCK
|
||||
SPL_AC_KUIDGID_T
|
||||
SPL_AC_PUT_TASK_STRUCT
|
||||
SPL_AC_KVASPRINTF
|
||||
SPL_AC_EXPORTED_RWSEM_IS_LOCKED
|
||||
SPL_AC_KERNEL_FALLOCATE
|
||||
SPL_AC_KERN_PATH
|
||||
@ -1180,24 +1179,6 @@ AC_DEFUN([SPL_AC_PUT_TASK_STRUCT],
|
||||
])
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # 2.6.x API change,
|
||||
dnl # kvasprintf() function added.
|
||||
dnl #
|
||||
AC_DEFUN([SPL_AC_KVASPRINTF],
|
||||
[AC_MSG_CHECKING([whether kvasprintf() is available])
|
||||
SPL_LINUX_TRY_COMPILE_SYMBOL([
|
||||
#include <linux/kernel.h>
|
||||
], [
|
||||
kvasprintf(0, NULL, *((va_list*)NULL));
|
||||
], [kvasprintf], [], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_KVASPRINTF, 1, [kvasprintf() is available])
|
||||
], [
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # 2.6.29 API change,
|
||||
dnl # vfs_fsync() funcation added, prior to this use file_fsync().
|
||||
|
@ -128,29 +128,6 @@ kmem_debugging(void)
|
||||
}
|
||||
EXPORT_SYMBOL(kmem_debugging);
|
||||
|
||||
#ifndef HAVE_KVASPRINTF
|
||||
/* Simplified asprintf. */
|
||||
char *kvasprintf(gfp_t gfp, const char *fmt, va_list ap)
|
||||
{
|
||||
unsigned int len;
|
||||
char *p;
|
||||
va_list aq;
|
||||
|
||||
va_copy(aq, ap);
|
||||
len = vsnprintf(NULL, 0, fmt, aq);
|
||||
va_end(aq);
|
||||
|
||||
p = kmalloc(len+1, gfp);
|
||||
if (!p)
|
||||
return NULL;
|
||||
|
||||
vsnprintf(p, len+1, fmt, ap);
|
||||
|
||||
return p;
|
||||
}
|
||||
EXPORT_SYMBOL(kvasprintf);
|
||||
#endif /* HAVE_KVASPRINTF */
|
||||
|
||||
char *
|
||||
kmem_vasprintf(const char *fmt, va_list ap)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user