<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/fs/btrfs/delayed-ref.h, branch linux-3.4.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.4.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.4.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2012-01-04T15:12:48Z</updated>
<entry>
<title>Btrfs: add waitqueue instead of doing busy waiting for more delayed refs</title>
<updated>2012-01-04T15:12:48Z</updated>
<author>
<name>Jan Schmidt</name>
</author>
<published>2011-12-12T15:10:07Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a168650c08300434e1456abe7b6451f1448230d3'/>
<id>urn:sha1:a168650c08300434e1456abe7b6451f1448230d3</id>
<content type='text'>
Now that we may be holding back delayed refs for a limited period, we
might end up having no runnable delayed refs. Without this commit, we'd
do busy waiting in that thread until another (runnable) ref arives.
Instead, we're detecting this situation and use a waitqueue, such that
we only try to run more refs after
	a) another runnable ref was added  or
	b) delayed refs are no longer held back

Signed-off-by: Jan Schmidt &lt;list.btrfs@jan-o-sch.net&gt;
</content>
</entry>
<entry>
<title>Btrfs: add sequence numbers to delayed refs</title>
<updated>2012-01-04T15:12:42Z</updated>
<author>
<name>Arne Jansen</name>
</author>
<published>2011-09-14T10:37:00Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=00f04b88791ff49dc64ada18819d40a5b0671709'/>
<id>urn:sha1:00f04b88791ff49dc64ada18819d40a5b0671709</id>
<content type='text'>
Sequence numbers are needed to reconstruct the backrefs of a given extent to
a certain point in time. The total set of backrefs consist of the set of
backrefs recorded on disk plus the enqueued delayed refs for it that existed
at that moment.

This patch also adds a list that records all delayed refs which are
currently in the process of being added.

When walking all refs of an extent in btrfs_find_all_roots(), we freeze the
current state of delayed refs, honor anythinh up to this point and prevent
processing newer delayed refs to assert consistency.

Signed-off-by: Arne Jansen &lt;sensille@gmx.net&gt;
Signed-off-by: Jan Schmidt &lt;list.btrfs@jan-o-sch.net&gt;
</content>
</entry>
<entry>
<title>Btrfs: always save ref_root in delayed refs</title>
<updated>2011-12-22T15:22:28Z</updated>
<author>
<name>Arne Jansen</name>
</author>
<published>2011-09-14T12:01:24Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=eebe063b7f916087cd5c61de57b20a3a30894a96'/>
<id>urn:sha1:eebe063b7f916087cd5c61de57b20a3a30894a96</id>
<content type='text'>
For consistent backref walking and (later) qgroup calculation the
information to which root a delayed ref belongs is useful even for shared
refs.

Signed-off-by: Arne Jansen &lt;sensille@gmx.net&gt;
Signed-off-by: Jan Schmidt &lt;list.btrfs@jan-o-sch.net&gt;
</content>
</entry>
<entry>
<title>Btrfs: mark delayed refs as for cow</title>
<updated>2011-12-22T15:22:27Z</updated>
<author>
<name>Arne Jansen</name>
</author>
<published>2011-09-12T13:26:38Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=66d7e7f09f77456fe68683247d77721032a00ee5'/>
<id>urn:sha1:66d7e7f09f77456fe68683247d77721032a00ee5</id>
<content type='text'>
Add a for_cow parameter to add_delayed_*_ref and pass the appropriate value
from every call site. The for_cow parameter will later on be used to
determine if a ref will change anything with respect to qgroups.

Delayed refs coming from relocation are always counted as for_cow, as they
don't change subvol quota.

Also pass in the fs_info for later use.

btrfs_find_all_roots() will use this as an optimization, as changes that are
for_cow will not change anything with respect to which root points to a
certain leaf. Thus, we don't need to add the current sequence number to
those delayed refs.

Signed-off-by: Arne Jansen &lt;sensille@gmx.net&gt;
Signed-off-by: Jan Schmidt &lt;list.btrfs@jan-o-sch.net&gt;
</content>
</entry>
<entry>
<title>btrfs: remove all unused functions</title>
<updated>2011-05-06T10:34:03Z</updated>
<author>
<name>David Sterba</name>
</author>
<published>2011-05-05T10:44:41Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f2a97a9dbd86eb1ef956bdf20e05c507b32beb96'/>
<id>urn:sha1:f2a97a9dbd86eb1ef956bdf20e05c507b32beb96</id>
<content type='text'>
Remove static and global declarations and/or definitions. Reduces size
of btrfs.ko by ~3.4kB.

  text    data     bss     dec     hex filename
402081    7464     200  409745   64091 btrfs.ko.base
398620    7144     200  405964   631cc btrfs.ko.remove-all

Signed-off-by: David Sterba &lt;dsterba@suse.cz&gt;
</content>
</entry>
<entry>
<title>btrfs: remove unused function prototypes</title>
<updated>2011-05-04T12:01:26Z</updated>
<author>
<name>David Sterba</name>
</author>
<published>2011-05-04T10:56:49Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=621496f4fd56195b7b273521f467c2945165481f'/>
<id>urn:sha1:621496f4fd56195b7b273521f467c2945165481f</id>
<content type='text'>
function prototypes without a body

Signed-off-by: David Sterba &lt;dsterba@suse.cz&gt;
</content>
</entry>
<entry>
<title>Btrfs: Integrate metadata reservation with start_transaction</title>
<updated>2010-05-25T14:34:50Z</updated>
<author>
<name>Yan, Zheng</name>
</author>
<published>2010-05-16T14:48:46Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a22285a6a32390195235171b89d157ed1a1fe932'/>
<id>urn:sha1:a22285a6a32390195235171b89d157ed1a1fe932</id>
<content type='text'>
Besides simplify the code, this change makes sure all metadata
reservation for normal metadata operations are released after
committing transaction.

Changes since V1:

Add code that check if unlink and rmdir will free space.

Add ENOSPC handling for clone ioctl.

Signed-off-by: Yan Zheng &lt;zheng.yan@oracle.com&gt;
Signed-off-by: Chris Mason &lt;chris.mason@oracle.com&gt;
</content>
</entry>
<entry>
<title>Btrfs: Mixed back reference  (FORWARD ROLLING FORMAT CHANGE)</title>
<updated>2009-06-10T15:29:46Z</updated>
<author>
<name>Yan Zheng</name>
</author>
<published>2009-06-10T14:45:14Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=5d4f98a28c7d334091c1b7744f48a1acdd2a4ae0'/>
<id>urn:sha1:5d4f98a28c7d334091c1b7744f48a1acdd2a4ae0</id>
<content type='text'>
This commit introduces a new kind of back reference for btrfs metadata.
Once a filesystem has been mounted with this commit, IT WILL NO LONGER
BE MOUNTABLE BY OLDER KERNELS.

When a tree block in subvolume tree is cow'd, the reference counts of all
extents it points to are increased by one.  At transaction commit time,
the old root of the subvolume is recorded in a "dead root" data structure,
and the btree it points to is later walked, dropping reference counts
and freeing any blocks where the reference count goes to 0.

The increments done during cow and decrements done after commit cancel out,
and the walk is a very expensive way to go about freeing the blocks that
are no longer referenced by the new btree root.  This commit reduces the
transaction overhead by avoiding the need for dead root records.

When a non-shared tree block is cow'd, we free the old block at once, and the
new block inherits old block's references. When a tree block with reference
count &gt; 1 is cow'd, we increase the reference counts of all extents
the new block points to by one, and decrease the old block's reference count by
one.

This dead tree avoidance code removes the need to modify the reference
counts of lower level extents when a non-shared tree block is cow'd.
But we still need to update back ref for all pointers in the block.
This is because the location of the block is recorded in the back ref
item.

We can solve this by introducing a new type of back ref. The new
back ref provides information about pointer's key, level and in which
tree the pointer lives. This information allow us to find the pointer
by searching the tree. The shortcoming of the new back ref is that it
only works for pointers in tree blocks referenced by their owner trees.

This is mostly a problem for snapshots, where resolving one of these
fuzzy back references would be O(number_of_snapshots) and quite slow.
The solution used here is to use the fuzzy back references in the common
case where a given tree block is only referenced by one root,
and use the full back references when multiple roots have a reference
on a given block.

This commit adds per subvolume red-black tree to keep trace of cached
inodes. The red-black tree helps the balancing code to find cached
inodes whose inode numbers within a given range.

This commit improves the balancing code by introducing several data
structures to keep the state of balancing. The most important one
is the back ref cache. It caches how the upper level tree blocks are
referenced. This greatly reduce the overhead of checking back ref.

The improved balancing code scales significantly better with a large
number of snapshots.

This is a very large commit and was written in a number of
pieces.  But, they depend heavily on the disk format change and were
squashed together to make sure git bisect didn't end up in a
bad state wrt space balancing or the format change.

Signed-off-by: Yan Zheng &lt;zheng.yan@oracle.com&gt;
Signed-off-by: Chris Mason &lt;chris.mason@oracle.com&gt;
</content>
</entry>
<entry>
<title>Btrfs: make sure btrfs_update_delayed_ref doesn't increase ref_mod</title>
<updated>2009-03-25T13:55:11Z</updated>
<author>
<name>Chris Mason</name>
</author>
<published>2009-03-25T13:55:11Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=1a81af4d1d9c60d4313309f937a1fc5567205a87'/>
<id>urn:sha1:1a81af4d1d9c60d4313309f937a1fc5567205a87</id>
<content type='text'>
btrfs_update_delayed_ref is optimized to add and remove different
references in one pass through the delayed ref tree.  It is a zero
sum on the total number of refs on a given extent.

But, the code was recording an extra ref in the head node.  This
never made it down to the disk but was used when deciding if it was
safe to free the extent while dropping snapshots.

The fix used here is to make sure the ref_mod count is unchanged
on the head ref when btrfs_update_delayed_ref is called.

Signed-off-by: Chris Mason &lt;chris.mason@oracle.com&gt;
</content>
</entry>
<entry>
<title>Btrfs: process the delayed reference queue in clusters</title>
<updated>2009-03-24T20:14:26Z</updated>
<author>
<name>Chris Mason</name>
</author>
<published>2009-03-13T14:17:05Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c3e69d58e86c3917ae4e9e31b4acf490a7cafe60'/>
<id>urn:sha1:c3e69d58e86c3917ae4e9e31b4acf490a7cafe60</id>
<content type='text'>
The delayed reference queue maintains pending operations that need to
be done to the extent allocation tree.  These are processed by
finding records in the tree that are not currently being processed one at
a time.

This is slow because it uses lots of time searching through the rbtree
and because it creates lock contention on the extent allocation tree
when lots of different procs are running delayed refs at the same time.

This commit changes things to grab a cluster of refs for processing,
using a cursor into the rbtree as the starting point of the next search.
This way we walk smoothly through the rbtree.

Signed-off-by: Chris Mason &lt;chris.mason@oracle.com&gt;
</content>
</entry>
</feed>
