diff options
author | David Woodhouse <dwmw2@infradead.org> | 2009-04-19 08:02:41 -0400 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2009-06-10 11:29:53 -0400 |
commit | 163e783e6a8b1e8bcb4c9084d438091386b589df (patch) | |
tree | dd7fbe662b7c81ba8c548b309fed4376f07ea495 /fs/btrfs | |
parent | 6cbff00f4632c8060b06bfc9585805217f11e12e (diff) |
Btrfs: remove crc32c.h and use libcrc32c directly.
There's no need to preserve this abstraction; it used to let us use
hardware crc32c support directly, but libcrc32c is already doing that for us
through the crypto API -- so we're already using the Intel crc32c
acceleration where appropriate.
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs')
-rw-r--r-- | fs/btrfs/crc32c.h | 29 | ||||
-rw-r--r-- | fs/btrfs/disk-io.c | 4 | ||||
-rw-r--r-- | fs/btrfs/extent-tree.c | 7 | ||||
-rw-r--r-- | fs/btrfs/hash.h | 4 |
4 files changed, 7 insertions, 37 deletions
diff --git a/fs/btrfs/crc32c.h b/fs/btrfs/crc32c.h deleted file mode 100644 index 6e1b3de36700..000000000000 --- a/fs/btrfs/crc32c.h +++ /dev/null | |||
@@ -1,29 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2008 Oracle. All rights reserved. | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or | ||
5 | * modify it under the terms of the GNU General Public | ||
6 | * License v2 as published by the Free Software Foundation. | ||
7 | * | ||
8 | * This program is distributed in the hope that it will be useful, | ||
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
11 | * General Public License for more details. | ||
12 | * | ||
13 | * You should have received a copy of the GNU General Public | ||
14 | * License along with this program; if not, write to the | ||
15 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, | ||
16 | * Boston, MA 021110-1307, USA. | ||
17 | */ | ||
18 | |||
19 | #ifndef __BTRFS_CRC32C__ | ||
20 | #define __BTRFS_CRC32C__ | ||
21 | #include <linux/crc32c.h> | ||
22 | |||
23 | /* | ||
24 | * this file used to do more for selecting the HW version of crc32c, | ||
25 | * perhaps it will one day again soon. | ||
26 | */ | ||
27 | #define btrfs_crc32c(seed, data, length) crc32c(seed, data, length) | ||
28 | #endif | ||
29 | |||
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index f4dfbb7ab496..6c54c210dfd0 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c | |||
@@ -26,8 +26,8 @@ | |||
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> | ||
29 | #include "compat.h" | 30 | #include "compat.h" |
30 | #include "crc32c.h" | ||
31 | #include "ctree.h" | 31 | #include "ctree.h" |
32 | #include "disk-io.h" | 32 | #include "disk-io.h" |
33 | #include "transaction.h" | 33 | #include "transaction.h" |
@@ -171,7 +171,7 @@ out: | |||
171 | 171 | ||
172 | u32 btrfs_csum_data(struct btrfs_root *root, char *data, u32 seed, size_t len) | 172 | u32 btrfs_csum_data(struct btrfs_root *root, char *data, u32 seed, size_t len) |
173 | { | 173 | { |
174 | return btrfs_crc32c(seed, data, len); | 174 | return crc32c(seed, data, len); |
175 | } | 175 | } |
176 | 176 | ||
177 | void btrfs_csum_final(u32 crc, char *result) | 177 | void btrfs_csum_final(u32 crc, char *result) |
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index 3355d7ea8308..33a65f2c8a37 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c | |||
@@ -23,7 +23,6 @@ | |||
23 | #include <linux/rcupdate.h> | 23 | #include <linux/rcupdate.h> |
24 | #include "compat.h" | 24 | #include "compat.h" |
25 | #include "hash.h" | 25 | #include "hash.h" |
26 | #include "crc32c.h" | ||
27 | #include "ctree.h" | 26 | #include "ctree.h" |
28 | #include "disk-io.h" | 27 | #include "disk-io.h" |
29 | #include "print-tree.h" | 28 | #include "print-tree.h" |
@@ -625,11 +624,11 @@ static u64 hash_extent_data_ref(u64 root_objectid, u64 owner, u64 offset) | |||
625 | __le64 lenum; | 624 | __le64 lenum; |
626 | 625 | ||
627 | lenum = cpu_to_le64(root_objectid); | 626 | lenum = cpu_to_le64(root_objectid); |
628 | high_crc = btrfs_crc32c(high_crc, &lenum, sizeof(lenum)); | 627 | high_crc = crc32c(high_crc, &lenum, sizeof(lenum)); |
629 | lenum = cpu_to_le64(owner); | 628 | lenum = cpu_to_le64(owner); |
630 | low_crc = btrfs_crc32c(low_crc, &lenum, sizeof(lenum)); | 629 | low_crc = crc32c(low_crc, &lenum, sizeof(lenum)); |
631 | lenum = cpu_to_le64(offset); | 630 | lenum = cpu_to_le64(offset); |
632 | low_crc = btrfs_crc32c(low_crc, &lenum, sizeof(lenum)); | 631 | low_crc = crc32c(low_crc, &lenum, sizeof(lenum)); |
633 | 632 | ||
634 | return ((u64)high_crc << 31) ^ (u64)low_crc; | 633 | return ((u64)high_crc << 31) ^ (u64)low_crc; |
635 | } | 634 | } |
diff --git a/fs/btrfs/hash.h b/fs/btrfs/hash.h index 2a020b276768..db2ff9773b99 100644 --- a/fs/btrfs/hash.h +++ b/fs/btrfs/hash.h | |||
@@ -19,9 +19,9 @@ | |||
19 | #ifndef __HASH__ | 19 | #ifndef __HASH__ |
20 | #define __HASH__ | 20 | #define __HASH__ |
21 | 21 | ||
22 | #include "crc32c.h" | 22 | #include <linux/crc32c.h> |
23 | static inline u64 btrfs_name_hash(const char *name, int len) | 23 | static inline u64 btrfs_name_hash(const char *name, int len) |
24 | { | 24 | { |
25 | return btrfs_crc32c((u32)~1, name, len); | 25 | return crc32c((u32)~1, name, len); |
26 | } | 26 | } |
27 | #endif | 27 | #endif |