blob: efb715828cce7fc0e544ae69bc202b90111b9679 [file] [log] [blame]
Qu Wenruo565a4142020-06-24 18:02:48 +02001// SPDX-License-Identifier: GPL-2.0+
2#ifndef __BTRFS_DISK_IO_H__
3#define __BTRFS_DISK_IO_H__
4
5#include "crypto/hash.h"
6#include "ctree.h"
7#include "disk-io.h"
8
9static inline u64 btrfs_name_hash(const char *name, int len)
10{
11 u32 crc;
12
13 crc = crc32c((u32)~1, (unsigned char *)name, len);
14
15 return (u64)crc;
16}
17
18int btrfs_csum_data(u16 csum_type, const u8 *data, u8 *out, size_t len);
19
20#endif