blob: fd2e9b6127996372f9c60e71a6034c4879c7fd9d [file] [log] [blame]
Marek BehĂșn21a14fa2017-09-03 17:00:28 +02001/*
2 * BTRFS filesystem implementation for U-Boot
3 *
4 * 2017 Marek Behun, CZ.NIC, marek.behun@nic.cz
5 *
6 * SPDX-License-Identifier: GPL-2.0+
7 */
8
9#include <common.h>
10#include <compiler.h>
11#include <fs_internal.h>
12
13struct blk_desc *btrfs_blk_desc;
14disk_partition_t *btrfs_part_info;
15
16int btrfs_devread(u64 address, int byte_len, void *buf)
17{
18 lbaint_t sector;
19 int byte_offset;
20
21 sector = address >> btrfs_blk_desc->log2blksz;
22 byte_offset = address % btrfs_blk_desc->blksz;
23
24 return fs_devread(btrfs_blk_desc, btrfs_part_info, sector, byte_offset,
25 byte_len, buf);
26}