Commit Graph
21 Commits
Author SHA1 Message Date
Andreas Henriksson f6829b6ccf bfs: Factor the code to add a block_run to a data_stream out of _GrowStream()
This is done so the code can be reused when moving the file stream.

Change-Id: I4c31c14492904cf8d490ec3720450e3b54f00cbf
Reviewed-on: https://review.haiku-os.org/c/haiku/+/927
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2026-01-22 16:57:47 +00:00
ahenriksson e93c2b5609 bfs: BlockAllocator::Reinitialize()
Change-Id: I17d5fb7bbf963a4f03458ba9bd4aee49a757d571
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10059
Reviewed-by: Adrien Destugues <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2026-01-22 16:57:47 +00:00
ahenriksson 2f76872b8e bfs: support moving the journal
Add a way to request allocation of a specific block run to
BlockAllocator. Use it to allocate the new location for the journal.

Change-Id: I276de77d937253baa312049ad2964849c5e9b68b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10057
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2026-01-22 16:53:25 +00:00
Andreas Henriksson eba66a0e71 bfs: BlockAllocator: manage the allowed block range
All operations which allocate blocks must follow the block range
restriction during a resize operation. Since we do the resize live,
operations not originating from the resize work must also follow the
restriction. To implement that, we need to handle the restriction
directly in the BlockAllocator.

Change-Id: Ie6e06407e7ad2c0396818e2ef02be46d2bd01b99
Reviewed-on: https://review.haiku-os.org/c/haiku/+/932
Reviewed-by: Adrien Destugues <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2026-01-22 16:52:30 +00:00
Andreas Henriksson 3329194a32 bfs: support functions for moving an inode
Change-Id: I94bebc87b4b6ce467867f5672ffff6c7633f74d6
Reviewed-on: https://review.haiku-os.org/c/haiku/+/924
Reviewed-by: Axel Dörfler <[email protected]>
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2025-12-13 13:59:12 +00:00
ahenriksson 0b3f78e73b fs_shell: 'resizefs' command
Change-Id: Ie4c18c76cd1a69945739817ecd99409b7611dd7a
Reviewed-on: https://review.haiku-os.org/c/haiku/+/939
Reviewed-by: Jérôme Duval <[email protected]>
2020-01-01 10:24:30 +00:00
ahenriksson 03867a467e Add resizefs utility
Change-Id: I5f503cf07216df64dcc33081f24cd083d003e581
Reviewed-on: https://review.haiku-os.org/c/haiku/+/943
Reviewed-by: Jérôme Duval <[email protected]>
Reviewed-by: Axel Dörfler <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2019-08-20 09:48:51 +00:00
ahenriksson aa7750382a bfs: split checkfs code into FileSystemVisitor and CheckVisitor
Another FileSystemVisitor implementation will be used for resizing

Change-Id: I2d5f47dcbefb4c76834487b194a99c6f5ae7de50
Reviewed-on: https://review.haiku-os.org/c/923
Reviewed-by: Jérôme Duval <[email protected]>
2019-02-19 18:44:43 +00:00
ahenriksson 8497a2cc28 vfs: functions to change a vnode busy status and ID
The kernel version is only partially tested.

Change-Id: I9a2f6c78087154ab137eadbced99062a8a2dd688
Reviewed-on: https://review.haiku-os.org/c/918
Reviewed-by: waddlesplash <[email protected]>
2019-02-19 18:44:43 +00:00
ahenriksson c71d928ee0 bfs: Print diagnostic message when disk size is too small
Change-Id: Ie7bff78b1b0c783bc74f1fe774ec31f8437257df
Reviewed-on: https://review.haiku-os.org/c/922
Reviewed-by: Jérôme Duval <[email protected]>
2019-02-04 16:37:35 +00:00
ahenriksson 0ec6ced115 bfs: Flush transactions with no blocks in _FlushLog()
Since the file system resizing code must reinitialize the block cache,
it is necessary that it is completely empty.

Change-Id: If0df9f8c003edb4ccc65c4b42940512400f8598c
Reviewed-on: https://review.haiku-os.org/c/921
Reviewed-by: waddlesplash <[email protected]>
2019-02-04 16:37:35 +00:00
ahenriksson b9256c155b disk_device_manager: implement KFileSystem::Resize()
Change-Id: I122a3881b0d0a8febc23c9751d5e32018c26da5e
Reviewed-on: https://review.haiku-os.org/c/920
Reviewed-by: waddlesplash <[email protected]>
2019-02-04 16:37:35 +00:00
ahenriksson c3c2596d9b fs_shell: Add sscanf and vsscanf
Change-Id: I0f69ebb6bc12bb68488a0d0bdaa7b86f5b06bb99
Reviewed-on: https://review.haiku-os.org/c/938
Reviewed-by: Jérôme Duval <[email protected]>
2019-01-28 16:38:27 +00:00
Andreas Henriksson ae3a28bef3 BFS: Forgotten initialization in Index constructor
Change-Id: I1406ecb2a5e5ae6df88c63c4b64d3191daec59ac
Reviewed-on: https://review.haiku-os.org/c/914
Reviewed-by: waddlesplash <[email protected]>
2019-01-27 18:02:54 +00:00
Andreas Henriksson c4684f1e0b Change missed fs_mount::cookie access in fs_shell:vfs.cpp
See commit 7ffafac8d7
This change was made in the kernel version, but missed in fs_shell.
2013-11-16 00:29:40 +01:00
Andreas Henriksson 73d45183f9 Forgotten initialization in fs_shell
Signed-off-by: Axel Dörfler <[email protected]>
2013-11-16 00:28:44 +01:00
ahenriksson c9e66680b9 Incorrect checking of already set double indirect blocks
Wrong variable usage in inner loop caused some double indirect stream
runs to be checked twice when block size was smaller than
DOUBLE_INDIRECT_ARRAY_SIZE, while some were incorrectly marked as
unallocated in the bitmap.

Signed-off-by: Axel Dörfler <[email protected]>
2013-05-14 22:13:50 +02:00
ahenriksson 35dc734b48 Single values are allowed in regular duplicate nodes
Not in duplicate fragments, however. This oversight in hrev44359 made
checkfs incorrectly rebuild valid indices, causing #8762.

Signed-off-by: Axel Dörfler <[email protected]>
2012-08-06 20:05:46 +02:00
ahenriksson 0237895604 CheckBlocks() calculated the group block incorrectly
Signed-off-by: Axel Dörfler <[email protected]>
2012-07-20 01:02:05 +02:00
ahenriksson d9879eddbf A duplicate array with a single value is not allowed
Such arrays could be created by the BFS code between hrev43837 and
hrev43924, and cause the array to not be free'd when the entry is
removed.

The check in _InsertDuplicate() is not changed, as doing an insertion
will actually repair this problem.

Potentially, the code could be modified to handle this state instead,
but since checkfs can fix it, it doesn't seem necessary.

Signed-off-by: Axel Dörfler <[email protected]>
2012-07-20 01:02:03 +02:00
Andreas Henriksson 8959a4e0c3 An unused dirty block would put again into the unused list.
* This could cause bug #8123. While this fixes the crash, one underlying
  problem is still there, as dirty blocks should never leave a transaction.
2012-07-19 23:44:25 +02:00