aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs
diff options
context:
space:
mode:
authorFilipe David Borba Manana <fdmanana@gmail.com>2014-01-29 16:06:04 -0500
committerChris Mason <clm@fb.com>2014-02-03 12:01:27 -0500
commit0b947aff1599afbbd2ec07ada87b05af0f94cf10 (patch)
tree493e454078b2169ab97b5080390945589bb0d276 /fs/btrfs
parent8101c8dbf6243ba517aab58d69bf1bc37d8b7b9c (diff)
Btrfs: use btrfs_crc32c everywhere instead of libcrc32c
After the commit titled "Btrfs: fix btrfs boot when compiled as built-in", LIBCRC32C requirement was removed from btrfs' Kconfig. This made it not possible to build a kernel with btrfs enabled (either as module or built-in) if libcrc32c is not enabled as well. So just replace all uses of libcrc32c with the equivalent function in btrfs hash.h - btrfs_crc32c. Signed-off-by: Filipe David Borba Manana <fdmanana@gmail.com> Signed-off-by: Chris Mason <clm@fb.com>
Diffstat (limited to 'fs/btrfs')
-rw-r--r--fs/btrfs/check-integrity.c4
-rw-r--r--fs/btrfs/disk-io.c4
-rw-r--r--fs/btrfs/send.c4
3 files changed, 6 insertions, 6 deletions
diff --git a/fs/btrfs/check-integrity.c b/fs/btrfs/check-integrity.c
index 160fb509d720..39bfd56a1f26 100644
--- a/fs/btrfs/check-integrity.c
+++ b/fs/btrfs/check-integrity.c
@@ -92,11 +92,11 @@
92#include <linux/slab.h> 92#include <linux/slab.h>
93#include <linux/buffer_head.h> 93#include <linux/buffer_head.h>
94#include <linux/mutex.h> 94#include <linux/mutex.h>
95#include <linux/crc32c.h>
96#include <linux/genhd.h> 95#include <linux/genhd.h>
97#include <linux/blkdev.h> 96#include <linux/blkdev.h>
98#include "ctree.h" 97#include "ctree.h"
99#include "disk-io.h" 98#include "disk-io.h"
99#include "hash.h"
100#include "transaction.h" 100#include "transaction.h"
101#include "extent_io.h" 101#include "extent_io.h"
102#include "volumes.h" 102#include "volumes.h"
@@ -1823,7 +1823,7 @@ static int btrfsic_test_for_metadata(struct btrfsic_state *state,
1823 size_t sublen = i ? PAGE_CACHE_SIZE : 1823 size_t sublen = i ? PAGE_CACHE_SIZE :
1824 (PAGE_CACHE_SIZE - BTRFS_CSUM_SIZE); 1824 (PAGE_CACHE_SIZE - BTRFS_CSUM_SIZE);
1825 1825
1826 crc = crc32c(crc, data, sublen); 1826 crc = btrfs_crc32c(crc, data, sublen);
1827 } 1827 }
1828 btrfs_csum_final(crc, csum); 1828 btrfs_csum_final(crc, csum);
1829 if (memcmp(csum, h->csum, state->csum_size)) 1829 if (memcmp(csum, h->csum, state->csum_size))
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index 7619147da382..3903bd3f8d2b 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -26,7 +26,6 @@
26#include <linux/workqueue.h> 26#include <linux/workqueue.h>
27#include <linux/kthread.h> 27#include <linux/kthread.h>
28#include <linux/freezer.h> 28#include <linux/freezer.h>
29#include <linux/crc32c.h>
30#include <linux/slab.h> 29#include <linux/slab.h>
31#include <linux/migrate.h> 30#include <linux/migrate.h>
32#include <linux/ratelimit.h> 31#include <linux/ratelimit.h>
@@ -35,6 +34,7 @@
35#include <asm/unaligned.h> 34#include <asm/unaligned.h>
36#include "ctree.h" 35#include "ctree.h"
37#include "disk-io.h" 36#include "disk-io.h"
37#include "hash.h"
38#include "transaction.h" 38#include "transaction.h"
39#include "btrfs_inode.h" 39#include "btrfs_inode.h"
40#include "volumes.h" 40#include "volumes.h"
@@ -244,7 +244,7 @@ out:
244 244
245u32 btrfs_csum_data(char *data, u32 seed, size_t len) 245u32 btrfs_csum_data(char *data, u32 seed, size_t len)
246{ 246{
247 return crc32c(seed, data, len); 247 return btrfs_crc32c(seed, data, len);
248} 248}
249 249
250void btrfs_csum_final(u32 crc, char *result) 250void btrfs_csum_final(u32 crc, char *result)
diff --git a/fs/btrfs/send.c b/fs/btrfs/send.c
index 730dce395858..cf9107a64204 100644
--- a/fs/btrfs/send.c
+++ b/fs/btrfs/send.c
@@ -24,12 +24,12 @@
24#include <linux/xattr.h> 24#include <linux/xattr.h>
25#include <linux/posix_acl_xattr.h> 25#include <linux/posix_acl_xattr.h>
26#include <linux/radix-tree.h> 26#include <linux/radix-tree.h>
27#include <linux/crc32c.h>
28#include <linux/vmalloc.h> 27#include <linux/vmalloc.h>
29#include <linux/string.h> 28#include <linux/string.h>
30 29
31#include "send.h" 30#include "send.h"
32#include "backref.h" 31#include "backref.h"
32#include "hash.h"
33#include "locking.h" 33#include "locking.h"
34#include "disk-io.h" 34#include "disk-io.h"
35#include "btrfs_inode.h" 35#include "btrfs_inode.h"
@@ -620,7 +620,7 @@ static int send_cmd(struct send_ctx *sctx)
620 hdr->len = cpu_to_le32(sctx->send_size - sizeof(*hdr)); 620 hdr->len = cpu_to_le32(sctx->send_size - sizeof(*hdr));
621 hdr->crc = 0; 621 hdr->crc = 0;
622 622
623 crc = crc32c(0, (unsigned char *)sctx->send_buf, sctx->send_size); 623 crc = btrfs_crc32c(0, (unsigned char *)sctx->send_buf, sctx->send_size);
624 hdr->crc = cpu_to_le32(crc); 624 hdr->crc = cpu_to_le32(crc);
625 625
626 ret = write_buf(sctx->send_filp, sctx->send_buf, sctx->send_size, 626 ret = write_buf(sctx->send_filp, sctx->send_buf, sctx->send_size,