summaryrefslogtreecommitdiff
path: root/fs/btrfs/dev.c
diff options
context:
space:
mode:
authorMarek BehĂșn <marek.behun@nic.cz>2017-09-03 17:00:28 +0200
committerTom Rini <trini@konsulko.com>2017-10-02 21:52:17 -0400
commit21a14facb1494592c3ad4874c6a00539d15a29cf (patch)
tree96b0f5d1bfcbddff721717c6609ec401bd594ccf /fs/btrfs/dev.c
parent597b4aff7b5d85946d2028ab9498116f53357dbc (diff)
downloadu-boot-21a14facb1494592c3ad4874c6a00539d15a29cf.tar.gz
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
Diffstat (limited to 'fs/btrfs/dev.c')
-rw-r--r--fs/btrfs/dev.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/fs/btrfs/dev.c b/fs/btrfs/dev.c
new file mode 100644
index 0000000000..fd2e9b6127
--- /dev/null
+++ b/fs/btrfs/dev.c
@@ -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);
+}