u-boot/fs/btrfs/dev.c
Marek Behún 21a14facb1 fs: btrfs: Add single-device read-only BTRFS implementation
This adds the proper implementation for the BTRFS filesystem.
The implementation currently supports only read-only mode and
the filesystem can be only on a single device.

Checksums of data chunks is unimplemented.

Compression is implemented (ZLIB + LZO).

Signed-off-by: Marek Behun <marek.behun@nic.cz>

 create mode 100644 fs/btrfs/btrfs.h
 create mode 100644 fs/btrfs/chunk-map.c
 create mode 100644 fs/btrfs/compression.c
 create mode 100644 fs/btrfs/ctree.c
 create mode 100644 fs/btrfs/dev.c
 create mode 100644 fs/btrfs/dir-item.c
 create mode 100644 fs/btrfs/extent-io.c
 create mode 100644 fs/btrfs/hash.c
 create mode 100644 fs/btrfs/inode.c
 create mode 100644 fs/btrfs/root.c
 create mode 100644 fs/btrfs/subvolume.c
 create mode 100644 fs/btrfs/super.c
2017-10-02 21:52:17 -04:00

26 lines
570 B
C

/*
* BTRFS filesystem implementation for U-Boot
*
* 2017 Marek Behun, CZ.NIC, marek.behun@nic.cz
*
* SPDX-License-Identifier: GPL-2.0+
*/
#include <common.h>
#include <compiler.h>
#include <fs_internal.h>
struct blk_desc *btrfs_blk_desc;
disk_partition_t *btrfs_part_info;
int btrfs_devread(u64 address, int byte_len, void *buf)
{
lbaint_t sector;
int byte_offset;
sector = address >> btrfs_blk_desc->log2blksz;
byte_offset = address % btrfs_blk_desc->blksz;
return fs_devread(btrfs_blk_desc, btrfs_part_info, sector, byte_offset,
byte_len, buf);
}