History log of /haiku/src/add-ons/kernel/file_systems/btrfs/Volume.cpp
Revision Date Author Comments
# d72239d2 17-Apr-2020 Suhel Mehta <mehtasuhel@gmail.com>

Move DeviceOpener class to a separate file.

It is used by several of the filesystems, so it seems a good idea to
move it to the shared/ directory.

UFS2, BFS, XFS, EXT2 and EXFAT are adjusted.

Change-Id: I493e37a1e7d3ae24251469f82befd985a3c1dbdd
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2489
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>


# c5e9dd9b 10-Jan-2020 Adrien Destugues <pulkomandy@pulkomandy.tk>

Fix btrfs_shell build

The hacks to still use actual system headers for zlib didn't quite work.

- Define Z_SOLO, which makes zlib build without any system include
- Remove use of std::max and #include <algorithm> from AVLTree
- Do not include DebugSupport.h because it uses system headers
- Do not include uuid.h and define just what we need

Now it's possible to compile the btrfs_shell on Linux.

Change-Id: I74a14b5f6804db45ab5a9f582ab493d696376fd3
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2098
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>


# 8f40380d 15-Jul-2019 brjhaiku <brjhaiku@gmail.com>

btrfs: update superblock checksum on write

Note there are 32bytes on disk for the checksum, but only the first 4
are used. This is because btrfs can (or could, at some point?) use
sha256 instead of crc32 when higher reliability is needed (but high
performance isn't).

Change-Id: I8a2bcf8f462440568d9b3e2d9fbdb7208723bfb9
Reviewed-on: https://review.haiku-os.org/c/haiku/+/1596
Reviewed-by: Chế Vũ Gia Hy <ugen@cinnamon.is>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>


# 5fb44dff 26-Oct-2019 Augustin Cavalier <waddlesplash@gmail.com>

Revert "btrfs: update superblock checksum on write"

This reverts commit caf05af5dd9364af5fc808921f8b0c3a43736aaf.


# caf05af5 15-Jul-2019 brjhaiku <brjhaiku@gmail.com>

btrfs: update superblock checksum on write

Change-Id: I8a2bcf8f462440568d9b3e2d9fbdb7208723bfb9
Reviewed-on: https://review.haiku-os.org/c/haiku/+/1596
Reviewed-by: Chế Vũ Gia Hy <ugen@cinnamon.is>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>


# 4ffbc73f 08-Oct-2019 Adrien Destugues <pulkomandy@pulkomandy.tk>

btrfs: fix some warnings


# 4337c758 08-Oct-2019 Adrien Destugues <pulkomandy@pulkomandy.tk>

btrfs: do not create Journal and ExtentAllocator for read-only

They are not needed, and the ExtentAllocator seems to currently fail on
an empty volume I created for testing.


# 1418cade 11-Jul-2019 Augustin Cavalier <waddlesplash@gmail.com>

file_systems: Pass size argument to ioctl in a lot more places.


# aa08671d 08-Apr-2019 Les De Ridder <les@lesderid.net>

btrfs: partially implement filesystem initialization

Change-Id: I7fb3340dc39b3331d30e5113b5860d936efab253
Reviewed-on: https://review.haiku-os.org/c/1395
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>


# 99768086 29-Aug-2017 hyche <cvghy116@gmail.com>

BTRFS: Add author and license.

Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>


# 166917c9 28-Aug-2017 hyche <cvghy116@gmail.com>

BTRFS: Implement btrfs_create_dir that can create directories in most case.

We need to handle a case when node is full, the solution should be split or push data to another node.

Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>


# 4368661f 23-Aug-2017 hyche <cvghy116@gmail.com>

BTRFS: Implement GetNewBlock() function that will find the logical address for allocating and convert it to physical block.

Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>


# c1320b3a 23-Aug-2017 hyche <cvghy116@gmail.com>

BTRFS: Implement a simple journaling approach, this is not finished and mostly satisfy the need for passing Transaction object for many functions.

Some details about the current Journal:
* Journal can only end transaction.
* It holds a transaction id of fs (fCurrentGeneration) that increments each time a transaction starts.
* _TransactionWritten now just printing message.

Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>


# 8137f447 20-Aug-2017 hyche <cvghy116@gmail.com>

BTRFS: Fix memory leak

Missing delete for some tree roots.

Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>


# af419b0e 13-Aug-2017 hyche <cvghy116@gmail.com>

BTRFS: Implement ExtentAllocator

There are 4 new classes, structs:
* CachedExtent, is a AVLTreeNode, caches the extent locating in extent tree, a extent can be free, allocated, metadata or a data extent. It also hold a references count,
that is incremented each time a new extent refer to it (COW) and item data, that is only for allocated extent (NULL for free).
* CachedTreeExtent, is a AVLTree, cache the whole extent tree and has CachedExtent as its node.
* BlockGroup represents the group of extents that represent the region for each type of allocated extent. For example, region for data extents, metada blocks. It
responsible for inserting nodes in CachedTreeExtent.
* And the final, ExtentAllocator it knows how to allocate/deallocate extents, but for now only the allocating is implemented, actually allocating and deallocating works
are already implemented, they are in functions _AddFreeExtent, _AddAllocatedExtent in CachedTreeExtent. However the deallocating is not needed for now, so it will be
finished later then.

Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>


# 3216460d 12-Aug-2017 hyche <cvghy116@gmail.com>

BTRFS: Implement BTree::Path and change _Find.

Remove attribute fCurrentSlot in BTree::Node as it will be handled by Path explicitly. BTree control Path by passing its type in
BTree's method, Path also hold BTree type as its attribute to do some internal actions.
Add constant BTREE_KEY_TYPE_ANY, find search key has this type will success regardless of the found key's type.

Split the the _Find function into Traverse and GetEntry. Traverse will fill in the Path (nodes and slots) along way its finding,
GetEntry will get the item data, item size, key from leaf, if the slot is valid, that we have from Traverse. The _Find function also
check type if is correct and then retrieve. Doing this way there will be more flexible, the "read" flag is not needed as we only
need Path to manipulate tree, and it also enhance the performance at some points, because Path caches all the nodes from root to leaf,
so that we don't have to block_cache_put and block_cache_get after each finding.

Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>


# 16de9db5 12-Aug-2017 hyche <cvghy116@gmail.com>

BTRFS: Fix mismatched type of item size (should be uint32), and ObjectID of first subvolume when lookup directory (described in commit bd2dab1)

Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>


# 17b1b1c0 23-Jun-2017 hyche <cvghy116@gmail.com>

BTRFS: Some modifications for Volume.cpp

* Removed redundant codes when mounting roots
* Added TRACE
* Finding root should be "FindExact" to make it more understandable.

Signed-off-by: Adrien Destugues <pulkomandy@pulkomandy.tk>


# a420881a 23-Jun-2017 hyche <cvghy116@gmail.com>

BTRFS: Added retrieve RootBlock of BTree

Signed-off-by: Adrien Destugues <pulkomandy@pulkomandy.tk>


# fc4a1e78 22-Jun-2017 hyche <cvghy116@gmail.com>

BTRFS: Added SetRoot for tree. Tree root is initialized at mount time

Signed-off-by: Adrien Destugues <pulkomandy@pulkomandy.tk>


# 7568abd5 22-Jun-2017 hyche <cvghy116@gmail.com>

BTRFS: BlockNum -> LogicalAddress to prevent misunderstanding

Signed-off-by: Adrien Destugues <pulkomandy@pulkomandy.tk>


# bd2dab1c 16-Jun-2017 hyche <cvghy116@gmail.com>

BTRFS: Add some missing constants

Chunk tree objectID is 3,
256 is the objectID of first created subvolume in fs tree,
and also of first chunk tree (item in chunk tree).

Signed-off-by: Adrien Destugues <pulkomandy@pulkomandy.tk>


# 7e8e6c2e 09-Jun-2017 hyche <cvghy116@gmail.com>

BTRFS: Added retrieve sector size for later use

Signed-off-by: Adrien Destugues <pulkomandy@pulkomandy.tk>


# 299aba38 09-Jun-2017 hyche <cvghy116@gmail.com>

BTRFS: code cleanups

* Removed struct keyword for declaring variable.
* Renamed BPlusTree to BTree because BtrFS use a variant of BTree not B+Tree.

Signed-off-by: Adrien Destugues <pulkomandy@pulkomandy.tk>


# b24d4c8a 18-May-2017 hyche <cvghy116@gmail.com>

Fixed: Code style (again)

* Pointer/Reference should be next to type
* else if -> if
* Remove trailing spaces

Signed-off-by: Adrien Destugues <pulkomandy@pulkomandy.tk>


# bf5d0ce3 19-May-2017 hyche <cvghy116@gmail.com>

btrfs_shell for testing btrfs code.

* Adding Jamfile in src/tools/btrfs_shell and include the subdir in src/tools/Jamfile
* Adding system_dependencies.h in btrfs source to include all the system headers
* fs_shell wrapping for btrfs source. If FS_SHELL is defined, compile with fs_shell headers instead.
* Change macro BTRFS_SHELL to FS_SHELL
* Adding btrfs_std_ops function: fs_shell now can recognize and load module


# 8864a6cb 18-May-2017 hyche <cvghy116@gmail.com>

btrfs: Code style

* Using tab instead of spaces
* Pointer/Reference should be next to type
* etc


# 267a780a 06-May-2013 Jérôme Duval <jerome.duval@gmail.com>

btrfs: fixes 64 bit warnings


# 46cf7a5a 14-Nov-2012 Przemysław Buczkowski <przemub@yahoo.pl>

Fix typos: super block -> superblock (#8974)

Signed-off-by: Przemysław Buczkowski <przemub@yahoo.pl>
Signed-off-by: Matt Madia <mattmadia@gmail.com>


# 6f4c36e2 24-Jan-2011 Jérôme Duval <korli@users.berlios.de>

* Implemented a read-only btrfs file system, tested with a 400MB image.
* Inline extent data isn't read with the file_cache yet as the data is not block aligned.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40282 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 267a780ab5ba7e7774dc6b4a6d391ab3cfbb9f78 06-May-2013 Jérôme Duval <jerome.duval@gmail.com>

btrfs: fixes 64 bit warnings


# 46cf7a5a73679c6e4fde91710e4a4885242e49d1 14-Nov-2012 Przemysław Buczkowski <przemub@yahoo.pl>

Fix typos: super block -> superblock (#8974)

Signed-off-by: Przemysław Buczkowski <przemub@yahoo.pl>
Signed-off-by: Matt Madia <mattmadia@gmail.com>


# 6f4c36e2979b9684a65e6d73b872d4628f3e452a 24-Jan-2011 Jérôme Duval <korli@users.berlios.de>

* Implemented a read-only btrfs file system, tested with a 400MB image.
* Inline extent data isn't read with the file_cache yet as the data is not block aligned.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40282 a95241bf-73f2-0310-859d-f6bbb57e9c96