mirror of
https://xff.cz/git/u-boot/
synced 2025-09-01 16:52:14 +02:00
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
This commit is contained in:
26
fs/btrfs/dev.c
Normal file
26
fs/btrfs/dev.c
Normal file
@@ -0,0 +1,26 @@
|
||||
/*
|
||||
* 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);
|
||||
}
|
Reference in New Issue
Block a user