]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: Remove custom crc32c init code
authorNikolay Borisov <nborisov@suse.com>
Mon, 8 Jan 2018 09:45:05 +0000 (11:45 +0200)
committerDavid Sterba <dsterba@suse.com>
Mon, 26 Mar 2018 13:09:39 +0000 (15:09 +0200)
commit7ba770164a5460b4502d3962c2ed00b9d2ddd89b
tree2534b3d70f38acc7f2d4cc89a3f23ff7738c094a
parent38ca500fe185ace3647fdeb4cdfd40bc6a3d60f3
btrfs: Remove custom crc32c init code

The custom crc32 init code was introduced in
aba7557bc08c ("Btrfs: fix btrfs boot when compiled as built-in") to
enable using btrfs as a built-in. However, later as pointed out by
2ee3d0477128 ("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>
16 files changed:
fs/btrfs/Kconfig
fs/btrfs/Makefile
fs/btrfs/check-integrity.c
fs/btrfs/ctree.h
fs/btrfs/dir-item.c
fs/btrfs/disk-io.c
fs/btrfs/extent-tree.c
fs/btrfs/hash.c [deleted file]
fs/btrfs/hash.h [deleted file]
fs/btrfs/inode-item.c
fs/btrfs/inode.c
fs/btrfs/props.c
fs/btrfs/send.c
fs/btrfs/super.c
fs/btrfs/tree-checker.c
fs/btrfs/tree-log.c