| * Copyright (C) 2014 Filipe David Borba Manana <fdmanana@gmail.com> |
| * This program is free software; you can redistribute it and/or |
| * modify it under the terms of the GNU General Public |
| * License v2 as published by the Free Software Foundation. |
| * This program is distributed in the hope that it will be useful, |
| * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| * General Public License for more details. |
| static struct crypto_shash *tfm; |
| int __init btrfs_hash_init(void) |
| tfm = crypto_alloc_shash("crc32c", 0, 0); |
| void btrfs_hash_exit(void) |
| u32 btrfs_crc32c(u32 crc, const void *address, unsigned int length) |
| char ctx[crypto_shash_descsize(tfm)]; |
| err = crypto_shash_update(&desc.shash, address, length); |