Skip to content

Commit

Permalink
config: remove HAVE_SUPER_SETUP_BDI_NAME
Browse files Browse the repository at this point in the history
Sponsored-by: https://despairlabs.com/sponsor/
Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: Tony Hutter <[email protected]>
Reviewed-by: Tino Reichardt <[email protected]>
Signed-off-by: Rob Norris <[email protected]>
Closes #16479
  • Loading branch information
robn authored and behlendorf committed Sep 18, 2024
1 parent b32b6ac commit 2de2031
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 111 deletions.
56 changes: 0 additions & 56 deletions config/kernel-bdi.m4

This file was deleted.

2 changes: 0 additions & 2 deletions config/kernel.m4
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ AC_DEFUN([ZFS_AC_KERNEL_TEST_SRC], [
ZFS_AC_KERNEL_SRC_TRUNCATE_SETSIZE
ZFS_AC_KERNEL_SRC_SECURITY_INODE
ZFS_AC_KERNEL_SRC_FST_MOUNT
ZFS_AC_KERNEL_SRC_BDI
ZFS_AC_KERNEL_SRC_SET_NLINK
ZFS_AC_KERNEL_SRC_SGET
ZFS_AC_KERNEL_SRC_VFS_FILEMAP_DIRTY_FOLIO
Expand Down Expand Up @@ -191,7 +190,6 @@ AC_DEFUN([ZFS_AC_KERNEL_TEST_RESULT], [
ZFS_AC_KERNEL_TRUNCATE_SETSIZE
ZFS_AC_KERNEL_SECURITY_INODE
ZFS_AC_KERNEL_FST_MOUNT
ZFS_AC_KERNEL_BDI
ZFS_AC_KERNEL_SET_NLINK
ZFS_AC_KERNEL_SGET
ZFS_AC_KERNEL_VFS_FILEMAP_DIRTY_FOLIO
Expand Down
48 changes: 0 additions & 48 deletions include/os/linux/kernel/linux/vfs_compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,54 +32,6 @@
#include <linux/backing-dev.h>
#include <linux/compat.h>

/*
* 4.0 - 4.11, bdi_setup_and_register() takes 2 arguments.
* 4.12 - x.y, super_setup_bdi_name() new interface.
*/
#if defined(HAVE_SUPER_SETUP_BDI_NAME)
extern atomic_long_t zfs_bdi_seq;

static inline int
zpl_bdi_setup(struct super_block *sb, char *name)
{
return super_setup_bdi_name(sb, "%.28s-%ld", name,
atomic_long_inc_return(&zfs_bdi_seq));
}
static inline void
zpl_bdi_destroy(struct super_block *sb)
{
}
#elif defined(HAVE_2ARGS_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);
if (error) {
kmem_free(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

/*
* 4.14 adds SB_* flag definitions, define them to MS_* equivalents
* if not set.
Expand Down
8 changes: 3 additions & 5 deletions module/os/linux/zfs/zfs_vfsops.c
Original file line number Diff line number Diff line change
Expand Up @@ -1385,9 +1385,7 @@ zfsvfs_teardown(zfsvfs_t *zfsvfs, boolean_t unmounting)
return (0);
}

#if defined(HAVE_SUPER_SETUP_BDI_NAME)
atomic_long_t zfs_bdi_seq = ATOMIC_LONG_INIT(0);
#endif
static atomic_long_t zfs_bdi_seq = ATOMIC_LONG_INIT(0);

int
zfs_domount(struct super_block *sb, zfs_mnt_t *zm, int silent)
Expand Down Expand Up @@ -1448,7 +1446,8 @@ zfs_domount(struct super_block *sb, zfs_mnt_t *zm, int silent)
sb->s_blocksize = recordsize;
sb->s_blocksize_bits = ilog2(recordsize);

error = -zpl_bdi_setup(sb, "zfs");
error = -super_setup_bdi_name(sb, "%.28s-%ld", "zfs",
atomic_long_inc_return(&zfs_bdi_seq));
if (error)
goto out;

Expand Down Expand Up @@ -1576,7 +1575,6 @@ zfs_umount(struct super_block *sb)
arc_remove_prune_callback(zfsvfs->z_arc_prune);
VERIFY(zfsvfs_teardown(zfsvfs, B_TRUE) == 0);
os = zfsvfs->z_os;
zpl_bdi_destroy(sb);

/*
* z_os will be NULL if there was an error in
Expand Down

0 comments on commit 2de2031

Please sign in to comment.