2020-06-24 16:02:48 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0+
|
|
|
|
#ifndef __BTRFS_DISK_IO_H__
|
|
|
|
#define __BTRFS_DISK_IO_H__
|
|
|
|
|
2020-06-24 16:02:49 +00:00
|
|
|
#include <linux/sizes.h>
|
|
|
|
#include <fs_internal.h>
|
2020-06-24 16:02:48 +00:00
|
|
|
#include "crypto/hash.h"
|
|
|
|
#include "ctree.h"
|
|
|
|
#include "disk-io.h"
|
|
|
|
|
2020-06-24 16:02:49 +00:00
|
|
|
#define BTRFS_SUPER_INFO_OFFSET SZ_64K
|
|
|
|
#define BTRFS_SUPER_INFO_SIZE SZ_4K
|
2020-06-24 16:02:48 +00:00
|
|
|
static inline u64 btrfs_name_hash(const char *name, int len)
|
|
|
|
{
|
|
|
|
u32 crc;
|
|
|
|
|
|
|
|
crc = crc32c((u32)~1, (unsigned char *)name, len);
|
|
|
|
|
|
|
|
return (u64)crc;
|
|
|
|
}
|
|
|
|
|
|
|
|
int btrfs_csum_data(u16 csum_type, const u8 *data, u8 *out, size_t len);
|
|
|
|
|
2020-06-24 16:02:49 +00:00
|
|
|
int btrfs_read_dev_super(struct blk_desc *desc, struct disk_partition *part,
|
|
|
|
struct btrfs_super_block *sb);
|
|
|
|
int btrfs_read_superblock(void);
|
2020-06-24 16:02:48 +00:00
|
|
|
#endif
|