mirror of
				https://git.proxmox.com/git/mirror_zfs.git
				synced 2025-10-26 18:05:04 +03:00 
			
		
		
		
	config: remove HAVE_SUPER_SETUP_BDI_NAME
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
							
								
									656b666bdb
								
							
						
					
					
						commit
						2326e2eb74
					
				| @ -1,56 +0,0 @@ | ||||
| dnl # | ||||
| dnl # Check available BDI interfaces. | ||||
| dnl # | ||||
| AC_DEFUN([ZFS_AC_KERNEL_SRC_BDI], [ | ||||
| 	ZFS_LINUX_TEST_SRC([super_setup_bdi_name], [ | ||||
| 		#include <linux/fs.h> | ||||
| 		struct super_block sb; | ||||
| 	], [ | ||||
| 		char *name = "bdi"; | ||||
| 		atomic_long_t zfs_bdi_seq; | ||||
| 		int error __attribute__((unused)); | ||||
| 		atomic_long_set(&zfs_bdi_seq, 0); | ||||
| 		error = | ||||
| 		    super_setup_bdi_name(&sb, "%.28s-%ld", name, | ||||
| 		    atomic_long_inc_return(&zfs_bdi_seq)); | ||||
| 	]) | ||||
| 
 | ||||
| 	ZFS_LINUX_TEST_SRC([bdi_setup_and_register], [ | ||||
| 		#include <linux/backing-dev.h> | ||||
| 		struct backing_dev_info bdi; | ||||
| 	], [ | ||||
| 		char *name = "bdi"; | ||||
| 		int error __attribute__((unused)) = | ||||
| 		    bdi_setup_and_register(&bdi, name); | ||||
| 	]) | ||||
| ]) | ||||
| 
 | ||||
| AC_DEFUN([ZFS_AC_KERNEL_BDI], [ | ||||
| 	dnl # | ||||
| 	dnl # 4.12, super_setup_bdi_name() introduced. | ||||
| 	dnl # | ||||
| 	AC_MSG_CHECKING([whether super_setup_bdi_name() exists]) | ||||
| 	ZFS_LINUX_TEST_RESULT_SYMBOL([super_setup_bdi_name], | ||||
| 	    [super_setup_bdi_name], [fs/super.c], [ | ||||
| 		AC_MSG_RESULT(yes) | ||||
| 		AC_DEFINE(HAVE_SUPER_SETUP_BDI_NAME, 1, | ||||
|                     [super_setup_bdi_name() exits]) | ||||
| 	], [ | ||||
| 		AC_MSG_RESULT(no) | ||||
| 
 | ||||
| 		dnl # | ||||
| 		dnl # 4.0 - 4.11, bdi_setup_and_register() takes 2 arguments. | ||||
| 		dnl # | ||||
| 		AC_MSG_CHECKING( | ||||
| 		    [whether bdi_setup_and_register() wants 2 args]) | ||||
| 		ZFS_LINUX_TEST_RESULT_SYMBOL([bdi_setup_and_register], | ||||
| 		    [bdi_setup_and_register], [mm/backing-dev.c], [ | ||||
| 			AC_MSG_RESULT(yes) | ||||
| 			AC_DEFINE(HAVE_2ARGS_BDI_SETUP_AND_REGISTER, 1, | ||||
| 			    [bdi_setup_and_register() wants 2 args]) | ||||
| 		], [ | ||||
| 			AC_MSG_RESULT(no) | ||||
| 			ZFS_LINUX_TEST_ERROR([bdi_setup]) | ||||
| 		]) | ||||
| 	]) | ||||
| ]) | ||||
| @ -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 | ||||
| @ -190,7 +189,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 | ||||
|  | ||||
| @ -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. | ||||
|  | ||||
| @ -1378,9 +1378,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) | ||||
| @ -1441,7 +1439,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; | ||||
| 
 | ||||
| @ -1569,7 +1568,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 | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 Rob Norris
						Rob Norris