summaryrefslogtreecommitdiffstats
path: root/fs/btrfs
Commit message (Collapse)AuthorAgeFilesLines
...
* fs: btrfs: Fix not all CHUNK_ITEMs being read from CHUNK_TREEYevgeny Popovych2018-06-131-1/+1
| | | | | | | | | | | | | | | | This causes errors when translating logical addresses to physical: btrfs_map_logical_to_physical: Cannot map logical address <addr> to physical btrfs_file_read: Error reading extent The behavior of btrfs_map_logical_to_physical() is to stop traversing CHUNK_TREE when it encounters first non-CHUNK_ITEM, which makes only some portion of CHUNK_ITEMs being read. Change it to skip over non-chunk items. Signed-off-by: Yevgeny Popovych <yevgenyp@pointgrab.com> Cc: Marek Behun <marek.behun@nic.cz> Cc: Sergey Struzh <sergeys@pointgrab.com> Reviewed-by: Marek Behun <marek.behun@nic.cz>
* SPDX: Convert all of our single license tags to Linux Kernel styleTom Rini2018-05-0717-35/+17
| | | | | | | | | | | | | | | | | | | | When U-Boot started using SPDX tags we were among the early adopters and there weren't a lot of other examples to borrow from. So we picked the area of the file that usually had a full license text and replaced it with an appropriate SPDX-License-Identifier: entry. Since then, the Linux Kernel has adopted SPDX tags and they place it as the very first line in a file (except where shebangs are used, then it's second line) and with slightly different comment styles than us. In part due to community overlap, in part due to better tag visibility and in part for other minor reasons, switch over to that style. This commit changes all instances where we have a single declared license in the tag as both the before and after are identical in tag contents. There's also a few places where I found we did not have a tag and have introduced one. Signed-off-by: Tom Rini <trini@konsulko.com>
* fs: btrfs: Remove unused debug code left from developmentMarek Behún2018-04-062-14/+0
| | | | Signed-off-by: Marek Behun <marek.behun@nic.cz>
* fs: btrfs: Fix printf format character warningTom Rini2018-01-291-2/+2
| | | | | | | | When printing a size_t value we need to use %zu for portability between 32bit and 64bit targets. Signed-off-by: Tom Rini <trini@konsulko.com> Reviewed-by: Marek Behun <marek.behun@nic.cz>
* fs: btrfs: Fix unaligned memory accessesAlberto Sánchez Molero2018-01-282-3/+5
| | | | | | | | | | | | | | Loading files stored with lzo compression from a btrfs filesystem was producing unaligned memory accesses, which were causing a data abort and a reset on an Orange Pi Zero. The change in hash.c is not triggered by any error but follows the same pattern. Please confirm. Fixed according to doc/README.unaligned-memory-access.txt Signed-off-by: Alberto Sánchez Molero <alsamolero@gmail.com> Tested-by: Robert Nelson <robertcnelson@gmail.com>
* fs: btrfs: Remove a foreign language noteMarek Behún2017-10-161-1/+0
| | | | | | I accidentaly left a foreign language note in the code from development. Signed-off-by: Marek Behun <marek.behun@nic.cz>
* fs: btrfs: Fix usage of uninitialized variablesMarek Behún2017-10-163-3/+3
| | | | | | | | | | | The variable res should be initialized to 0 in these functions, because if the searched key is not found, the variable is used uninitialized. Reported-by: Coverity (CID: 167335) Reported-by: Coverity (CID: 167336) Reported-by: Coverity (CID: 167337) Signed-off-by: Marek Behun <marek.behun@nic.cz>
* fs/btrfs: Fix warning in btrfs_check_super()Tom Rini2017-10-031-1/+1
| | | | | | We specifically say that the last arg is u32, so use %lu. Signed-off-by: Tom Rini <trini@konsulko.com>
* fs: btrfs: Add U-Boot fs handlers.Marek Behún2017-10-023-0/+244
| | | | | | | | | Signed-off-by: Marek Behun <marek.behun@nic.cz> create mode 100644 fs/btrfs/Kconfig create mode 100644 fs/btrfs/Makefile create mode 100644 fs/btrfs/btrfs.c create mode 100644 include/btrfs.h
* fs: btrfs: Add single-device read-only BTRFS implementationMarek Behún2017-10-0212-0/+1841
| | | | | | | | | | | | | | | | | | | | | | | | | 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
* fs: btrfs: Add disk-to-cpu and cpu-to-disk conversion functionsMarek Behún2017-10-021-0/+176
| | | | | | | | | | | | | | | BTRFS on disk structures are stored in Little Endian. Add functions to convert this structures to cpu and to disk format. On Little Endian hosts, these functions do nothing. On Big Endian the CALL_MACRO_FROM_EACH from variadic-macro.h is used to define all the members for each structure on which cpu_to_le* or le*_to_cpu is to be called. Signed-off-by: Marek Behun <marek.behun@nic.cz> create mode 100644 fs/btrfs/conv-funcs.h
* fs: btrfs: Add btrfs_tree.h and ctree.h from Linux (and modified)Marek Behún2017-10-022-0/+1100
Add btrfs_tree.h and ctree.h from Linux which contains constants and structures for the BTRFS filesystem. Signed-off-by: Marek Behun <marek.behun@nic.cz> create mode 100644 fs/btrfs/btrfs_tree.h create mode 100644 fs/btrfs/ctree.h