diff options
author | Nikolay Borisov <nborisov@suse.com> | 2018-01-08 11:45:05 +0200 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2018-03-26 15:09:39 +0200 |
commit | 9678c54388b6a6b309ff7ee5c8d23fa9eba7c06f (patch) | |
tree | 2534b3d70f38acc7f2d4cc89a3f23ff7738c094a /fs/btrfs/super.c | |
parent | df91f56adce1fc131e05368a0ad0ea72afd9a79a (diff) | |
download | linux-9678c54388b6a6b309ff7ee5c8d23fa9eba7c06f.tar.bz2 |
btrfs: Remove custom crc32c init code
The custom crc32 init code was introduced in
14a958e678cd ("Btrfs: fix btrfs boot when compiled as built-in") to
enable using btrfs as a built-in. However, later as pointed out by
60efa5eb2e88 ("Btrfs: use late_initcall instead of module_init") this
wasn't enough and finally btrfs was switched to late_initcall which
comes after the generic crc32c implementation is initiliased. The
latter commit superseeded the former. Now that we don't have to
maintain our own code let's just remove it and switch to using the
generic implementation.
Despite touching a lot of files the patch is really simple. Here is the gist of
the changes:
1. Select LIBCRC32C rather than the low-level modules.
2. s/btrfs_crc32c/crc32c/g
3. replace hash.h with linux/crc32c.h
4. Move the btrfs namehash funcs to ctree.h and change the tree accordingly.
I've tested this with btrfs being both a module and a built-in and xfstest
doesn't complain.
Does seem to fix the longstanding problem of not automatically selectiong
the crc32c module when btrfs is used. Possibly there is a workaround in
dracut.
The modinfo confirms that now all the module dependencies are there:
before:
depends: zstd_compress,zstd_decompress,raid6_pq,xor,zlib_deflate
after:
depends: libcrc32c,zstd_compress,zstd_decompress,raid6_pq,xor,zlib_deflate
Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
[ add more info to changelog from mails ]
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/super.c')
-rw-r--r-- | fs/btrfs/super.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c index 540c18511e7a..5d752f791950 100644 --- a/fs/btrfs/super.c +++ b/fs/btrfs/super.c @@ -41,6 +41,7 @@ #include <linux/slab.h> #include <linux/cleancache.h> #include <linux/ratelimit.h> +#include <linux/crc32c.h> #include <linux/btrfs.h> #include "delayed-inode.h" #include "ctree.h" @@ -48,7 +49,6 @@ #include "transaction.h" #include "btrfs_inode.h" #include "print-tree.h" -#include "hash.h" #include "props.h" #include "xattr.h" #include "volumes.h" @@ -2357,22 +2357,18 @@ static void __init btrfs_print_mod_info(void) ", ref-verify=on" #endif "\n", - btrfs_crc32c_impl()); + crc32c_impl()); } static int __init init_btrfs_fs(void) { int err; - err = btrfs_hash_init(); - if (err) - return err; - btrfs_props_init(); err = btrfs_init_sysfs(); if (err) - goto free_hash; + return err; btrfs_init_compress(); @@ -2453,8 +2449,7 @@ free_cachep: free_compress: btrfs_exit_compress(); btrfs_exit_sysfs(); -free_hash: - btrfs_hash_exit(); + return err; } @@ -2474,7 +2469,6 @@ static void __exit exit_btrfs_fs(void) btrfs_exit_sysfs(); btrfs_cleanup_fs_uuids(); btrfs_exit_compress(); - btrfs_hash_exit(); } late_initcall(init_btrfs_fs); |