<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/fs/btrfs/ctree.c, branch master</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=master</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=master'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2026-02-03T05:38:33Z</updated>
<entry>
<title>btrfs: merge setting ret and return ret</title>
<updated>2026-02-03T05:38:33Z</updated>
<author>
<name>David Sterba</name>
</author>
<published>2025-12-09T19:06:49Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=4b117be65ff41efae3694df449b9badb4e9d142e'/>
<id>urn:sha1:4b117be65ff41efae3694df449b9badb4e9d142e</id>
<content type='text'>
In many places we have pattern:

	ret = ...;
	return ret;

This can be simplified to a direct return, removing 'ret' if not
otherwise needed. The places in self tests are not converted so we can
add more test cases without changing surrounding code
(extent-map-tests.c:test_case_4()).

Signed-off-by: David Sterba &lt;dsterba@suse.com&gt;
</content>
</entry>
<entry>
<title>btrfs: simplify boolean argument for btrfs_inc_ref()/btrfs_dec_ref()</title>
<updated>2026-02-03T05:38:31Z</updated>
<author>
<name>Sun YangKai</name>
</author>
<published>2025-11-22T06:00:44Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a5eb9024368dac8cc6b317c1577c6348e5334243'/>
<id>urn:sha1:a5eb9024368dac8cc6b317c1577c6348e5334243</id>
<content type='text'>
Replace open-coded if/else blocks with the boolean directly and introduce
local const bool variables, making the code shorter and easier to read.

Signed-off-by: Sun YangKai &lt;sunk67188@gmail.com&gt;
Reviewed-by: David Sterba &lt;dsterba@suse.com&gt;
Signed-off-by: David Sterba &lt;dsterba@suse.com&gt;
</content>
</entry>
<entry>
<title>btrfs: use true/false for boolean parameters in btrfs_inc_ref()/btrfs_dec_ref()</title>
<updated>2026-02-03T05:38:31Z</updated>
<author>
<name>Sun YangKai</name>
</author>
<published>2025-11-22T06:00:43Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=8bfee251b7f5e54437e893c6daa964caded8a860'/>
<id>urn:sha1:8bfee251b7f5e54437e893c6daa964caded8a860</id>
<content type='text'>
Replace integer literals 0/1 with true/false when calling
btrfs_inc_ref() and btrfs_dec_ref() to make the code self-documenting
and avoid mixing bool/integer types.

Signed-off-by: Sun YangKai &lt;sunk67188@gmail.com&gt;
Reviewed-by: David Sterba &lt;dsterba@suse.com&gt;
Signed-off-by: David Sterba &lt;dsterba@suse.com&gt;
</content>
</entry>
<entry>
<title>btrfs: remove redundant level reset in btrfs_del_items()</title>
<updated>2025-11-25T00:50:56Z</updated>
<author>
<name>Sun YangKai</name>
</author>
<published>2025-11-14T07:24:48Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=4357dd76f558f03fe22f28c360f7798ee3a0d238'/>
<id>urn:sha1:4357dd76f558f03fe22f28c360f7798ee3a0d238</id>
<content type='text'>
When btrfs_del_items() empties a leaf, it deletes the leaf unless it's
the root node. For the root leaf case, the code used to reset its level
to 0 via btrfs_set_header_level(). This is redundant as leaf nodes
always have level == 0.

Remove the unnecessary level assignment and invert the conditional to
handle only the non-root leaf deletion. The root leaf is correctly left
as-is.

Signed-off-by: Sun YangKai &lt;sunk67188@gmail.com&gt;
Reviewed-by: David Sterba &lt;dsterba@suse.com&gt;
Signed-off-by: David Sterba &lt;dsterba@suse.com&gt;
</content>
</entry>
<entry>
<title>btrfs: simplify leaf traversal after path release in btrfs_next_old_leaf()</title>
<updated>2025-11-25T00:50:56Z</updated>
<author>
<name>Sun YangKai</name>
</author>
<published>2025-11-14T07:24:47Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=139f75a3b1677c76bd845228ec49e50d69ce556e'/>
<id>urn:sha1:139f75a3b1677c76bd845228ec49e50d69ce556e</id>
<content type='text'>
After releasing the path in btrfs_next_old_leaf(), we need to re-check
the leaf because a balance operation may have added items or removed the
last item. The original code handled this with two separate conditional
blocks, the second marked with a lengthy comment explaining a "missed
case".

Merge these two blocks into a single logical structure that handles both
scenarios more clearly.

Also update the comment to be more concise and accurate, incorporating the
explanation directly into the main block rather than a separate annotation.

Signed-off-by: Sun YangKai &lt;sunk67188@gmail.com&gt;
Reviewed-by: David Sterba &lt;dsterba@suse.com&gt;
Signed-off-by: David Sterba &lt;dsterba@suse.com&gt;
</content>
</entry>
<entry>
<title>btrfs: optimize balance_level() path reference handling</title>
<updated>2025-11-25T00:50:56Z</updated>
<author>
<name>Sun YangKai</name>
</author>
<published>2025-11-14T07:24:46Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3afa17bf243cf384e8caa64e1e3fad8b543c7c83'/>
<id>urn:sha1:3afa17bf243cf384e8caa64e1e3fad8b543c7c83</id>
<content type='text'>
Instead of incrementing refcount on 'left' node when it's referenced by
path, simply transfer ownership to path and set left to NULL. This
eliminates:

- Unnecessary refcount increment/decrement operations
- Redundant conditional checks for left node cleanup

The path now consistently owns the left node reference when used.

Signed-off-by: Sun YangKai &lt;sunk67188@gmail.com&gt;
Reviewed-by: David Sterba &lt;dsterba@suse.com&gt;
Signed-off-by: David Sterba &lt;dsterba@suse.com&gt;
</content>
</entry>
<entry>
<title>btrfs: factor out root promotion logic into promote_child_to_root()</title>
<updated>2025-11-25T00:50:56Z</updated>
<author>
<name>Sun YangKai</name>
</author>
<published>2025-11-14T07:24:45Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=31b37b766753682ec1434bb591c5edee94649597'/>
<id>urn:sha1:31b37b766753682ec1434bb591c5edee94649597</id>
<content type='text'>
The balance_level() function is overly long and contains a cold code path
that handles promoting a child node to root when the root has only one item.
This code has distinct logic that is clearer and more maintainable when
isolated in its own function.

Signed-off-by: Sun YangKai &lt;sunk67188@gmail.com&gt;
Reviewed-by: David Sterba &lt;dsterba@suse.com&gt;
Signed-off-by: David Sterba &lt;dsterba@suse.com&gt;
</content>
</entry>
<entry>
<title>btrfs: use bool type for btrfs_path members used as booleans</title>
<updated>2025-11-24T21:42:25Z</updated>
<author>
<name>Filipe Manana</name>
</author>
<published>2025-11-14T16:00:04Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d7fe41044b3ac8f9b5965de499a13ac9ae947e79'/>
<id>urn:sha1:d7fe41044b3ac8f9b5965de499a13ac9ae947e79</id>
<content type='text'>
Many fields of struct btrfs_path are used as booleans but their type is
an unsigned int (of one 1 bit width to save space). Change the type to
bool keeping the :1 suffix so that they combine with the previous u8
fields in order to save space. This makes the code more clear by using
explicit true/false and more in line with the preferred style, preserving
the size of the structure.

Reviewed-by: Johannes Thumshirn &lt;johannes.thumshirn@wdc.com&gt;
Signed-off-by: Filipe Manana &lt;fdmanana@suse.com&gt;
Reviewed-by: David Sterba &lt;dsterba@suse.com&gt;
Signed-off-by: David Sterba &lt;dsterba@suse.com&gt;
</content>
</entry>
<entry>
<title>btrfs: update check_skip variable after unlocking current node</title>
<updated>2025-11-24T21:42:25Z</updated>
<author>
<name>Filipe Manana</name>
</author>
<published>2025-11-13T12:07:14Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c2b2504ece4089697bb7db115dc91e344dfed76f'/>
<id>urn:sha1:c2b2504ece4089697bb7db115dc91e344dfed76f</id>
<content type='text'>
There's no need to update the local variable 'check_skip' to false inside
the critical section delimited by the lock of the current node, so do it
after unlocking the node.

Reviewed-by: Qu Wenruo &lt;wqu@suse.com&gt;
Signed-off-by: Filipe Manana &lt;fdmanana@suse.com&gt;
Reviewed-by: David Sterba &lt;dsterba@suse.com&gt;
Signed-off-by: David Sterba &lt;dsterba@suse.com&gt;
</content>
</entry>
<entry>
<title>btrfs: abort transaction on item count overflow in __push_leaf_left()</title>
<updated>2025-11-24T21:42:25Z</updated>
<author>
<name>Filipe Manana</name>
</author>
<published>2025-11-13T16:44:41Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=5d8222a50ad37c98455da08b33ce49fe6b726c72'/>
<id>urn:sha1:5d8222a50ad37c98455da08b33ce49fe6b726c72</id>
<content type='text'>
If we try to push an item count from the right leaf that is greater than
the number of items in the leaf, we just emit a warning. This should
never happen but if it does we get an underflow in the new number of
items in the right leaf and chaos follows from it. So replace the warning
with proper error handling, by aborting the transaction and returning
-EUCLEAN, and proper logging by using btrfs_crit() instead of WARN(),
which gives us proper formatting and information about the filesystem.

Reviewed-by: Qu Wenruo &lt;wqu@suse.com&gt;
Signed-off-by: Filipe Manana &lt;fdmanana@suse.com&gt;
Reviewed-by: David Sterba &lt;dsterba@suse.com&gt;
Signed-off-by: David Sterba &lt;dsterba@suse.com&gt;
</content>
</entry>
</feed>
