aboutsummaryrefslogtreecommitdiffstats
path: root/module/zfs/zfs_vfsops.c
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2017-05-02 09:46:18 -0700
committerGitHub <[email protected]>2017-05-02 09:46:18 -0700
commit7dae2c81e7b2e68a596c5b431444be0fae308156 (patch)
tree7581727a7905b990c1f823592c47e9a0a50e1942 /module/zfs/zfs_vfsops.c
parent153b2285545509c082be56dbf3ba5041de5d6e48 (diff)
Linux 4.12 compat: super_setup_bdi_name()
All filesystems were converted to dynamically allocated BDIs. The destruction of backing_dev_info structures is handled as part of super block destruction. Refactor the code to abstract away the details of creating and destroying a BDI. Reviewed-by: Chunwei Chen <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #6089
Diffstat (limited to 'module/zfs/zfs_vfsops.c')
-rw-r--r--module/zfs/zfs_vfsops.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/module/zfs/zfs_vfsops.c b/module/zfs/zfs_vfsops.c
index 40fd5f764..15cadcad5 100644
--- a/module/zfs/zfs_vfsops.c
+++ b/module/zfs/zfs_vfsops.c
@@ -1568,7 +1568,8 @@ zfsvfs_teardown(zfsvfs_t *zfsvfs, boolean_t unmounting)
return (0);
}
-#if !defined(HAVE_2ARGS_BDI_SETUP_AND_REGISTER) && \
+#if !defined(HAVE_SUPER_SETUP_BDI_NAME) && \
+ !defined(HAVE_2ARGS_BDI_SETUP_AND_REGISTER) && \
!defined(HAVE_3ARGS_BDI_SETUP_AND_REGISTER)
atomic_long_t zfs_bdi_seq = ATOMIC_LONG_INIT(0);
#endif
@@ -1605,13 +1606,13 @@ zfs_domount(struct super_block *sb, zfs_mnt_t *zm, int silent)
sb->s_time_gran = 1;
sb->s_blocksize = recordsize;
sb->s_blocksize_bits = ilog2(recordsize);
- zfsvfs->z_bdi.ra_pages = 0;
- sb->s_bdi = &zfsvfs->z_bdi;
- error = -zpl_bdi_setup_and_register(&zfsvfs->z_bdi, "zfs");
+ error = -zpl_bdi_setup(sb, "zfs");
if (error)
goto out;
+ sb->s_bdi->ra_pages = 0;
+
/* Set callback operations for the file system. */
sb->s_op = &zpl_super_operations;
sb->s_xattr = zpl_xattr_handlers;
@@ -1732,7 +1733,7 @@ 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;
- bdi_destroy(sb->s_bdi);
+ zpl_bdi_destroy(sb);
/*
* z_os will be NULL if there was an error in