mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2024-11-17 01:51:00 +03:00
config: remove HAVE_3ARGS_BDI_SETUP_AND_REGISTER
Sponsored-by: https://despairlabs.com/sponsor/ Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Tony Hutter <hutter2@llnl.gov> Reviewed-by: Tino Reichardt <milky-zfs@mcmilk.de> Signed-off-by: Rob Norris <robn@despairlabs.com> Closes #16479
This commit is contained in:
parent
9f5c9af77c
commit
6a28491f8e
@ -23,16 +23,6 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_BDI], [
|
||||
int error __attribute__((unused)) =
|
||||
bdi_setup_and_register(&bdi, name);
|
||||
])
|
||||
|
||||
ZFS_LINUX_TEST_SRC([bdi_setup_and_register_3args], [
|
||||
#include <linux/backing-dev.h>
|
||||
struct backing_dev_info bdi;
|
||||
], [
|
||||
char *name = "bdi";
|
||||
unsigned int cap = BDI_CAP_MAP_COPY;
|
||||
int error __attribute__((unused)) =
|
||||
bdi_setup_and_register(&bdi, name, cap);
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_BDI], [
|
||||
@ -60,22 +50,7 @@ AC_DEFUN([ZFS_AC_KERNEL_BDI], [
|
||||
[bdi_setup_and_register() wants 2 args])
|
||||
], [
|
||||
AC_MSG_RESULT(no)
|
||||
|
||||
dnl #
|
||||
dnl # 2.6.34 - 3.19, bdi_setup_and_register()
|
||||
dnl # takes 3 arguments.
|
||||
dnl #
|
||||
AC_MSG_CHECKING(
|
||||
[whether bdi_setup_and_register() wants 3 args])
|
||||
ZFS_LINUX_TEST_RESULT_SYMBOL(
|
||||
[bdi_setup_and_register_3args],
|
||||
[bdi_setup_and_register], [mm/backing-dev.c], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_3ARGS_BDI_SETUP_AND_REGISTER, 1,
|
||||
[bdi_setup_and_register() wants 3 args])
|
||||
], [
|
||||
ZFS_LINUX_TEST_ERROR([bdi_setup])
|
||||
])
|
||||
ZFS_LINUX_TEST_ERROR([bdi_setup])
|
||||
])
|
||||
])
|
||||
])
|
||||
|
@ -33,7 +33,6 @@
|
||||
#include <linux/compat.h>
|
||||
|
||||
/*
|
||||
* 2.6.34 - 3.19, bdi_setup_and_register() takes 3 arguments.
|
||||
* 4.0 - 4.11, bdi_setup_and_register() takes 2 arguments.
|
||||
* 4.12 - x.y, super_setup_bdi_name() new interface.
|
||||
*/
|
||||
@ -77,33 +76,6 @@ zpl_bdi_destroy(struct super_block *sb)
|
||||
kmem_free(bdi, sizeof (struct backing_dev_info));
|
||||
sb->s_bdi = NULL;
|
||||
}
|
||||
#elif defined(HAVE_3ARGS_BDI_SETUP_AND_REGISTER)
|
||||
static inline int
|
||||
zpl_bdi_setup(struct super_block *sb, char *name)
|
||||
{
|
||||
struct backing_dev_info *bdi;
|
||||
int error;
|
||||
|
||||
bdi = kmem_zalloc(sizeof (struct backing_dev_info), KM_SLEEP);
|
||||
error = bdi_setup_and_register(bdi, name, BDI_CAP_MAP_COPY);
|
||||
if (error) {
|
||||
kmem_free(sb->s_bdi, sizeof (struct backing_dev_info));
|
||||
return (error);
|
||||
}
|
||||
|
||||
sb->s_bdi = bdi;
|
||||
|
||||
return (0);
|
||||
}
|
||||
static inline void
|
||||
zpl_bdi_destroy(struct super_block *sb)
|
||||
{
|
||||
struct backing_dev_info *bdi = sb->s_bdi;
|
||||
|
||||
bdi_destroy(bdi);
|
||||
kmem_free(bdi, sizeof (struct backing_dev_info));
|
||||
sb->s_bdi = NULL;
|
||||
}
|
||||
#else
|
||||
#error "Unsupported kernel"
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user