<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/fs/btrfs/root-tree.c, branch linux-2.6.34.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-2.6.34.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-2.6.34.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2012-03-14T14:56:58Z</updated>
<entry>
<title>Btrfs: Fix uninitialized root flags for subvolumes</title>
<updated>2012-03-14T14:56:58Z</updated>
<author>
<name>Li Zefan</name>
</author>
<published>2011-03-28T02:01:25Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f8943a36416ea03f9f767c2e6b6a1e3f9dbd435d'/>
<id>urn:sha1:f8943a36416ea03f9f767c2e6b6a1e3f9dbd435d</id>
<content type='text'>
commit 08fe4db170b4193603d9d31f40ebaf652d07ac9c upstream.

root_item-&gt;flags and root_item-&gt;byte_limit are not initialized when
a subvolume is created. This bug is not revealed until we added
readonly snapshot support - now you mount a btrfs filesystem and you
may find the subvolumes in it are readonly.

To work around this problem, we steal a bit from root_item-&gt;inode_item-&gt;flags,
and use it to indicate if those fields have been properly initialized.
When we read a tree root from disk, we check if the bit is set, and if
not we'll set the flag and initialize the two fields of the root item.

Reported-by: Andreas Philipp &lt;philipp.andreas@gmail.com&gt;
Signed-off-by: Li Zefan &lt;lizf@cn.fujitsu.com&gt;
Tested-by: Andreas Philipp &lt;philipp.andreas@gmail.com&gt;
Signed-off-by: Chris Mason &lt;chris.mason@oracle.com&gt;
Signed-off-by: Paul Gortmaker &lt;paul.gortmaker@windriver.com&gt;
</content>
</entry>
<entry>
<title>Btrfs: skip btrfs_release_path in btrfs_update_root and btrfs_del_root</title>
<updated>2009-11-11T19:20:18Z</updated>
<author>
<name>Li Dongyang</name>
</author>
<published>2009-11-06T14:33:01Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=df66916e71231e9f2377cac9c5c1e2d190f9a427'/>
<id>urn:sha1:df66916e71231e9f2377cac9c5c1e2d190f9a427</id>
<content type='text'>
We don't need to call btrfs_release_path because btrfs_free_path will do
that for us.

Signed-off-by: Li Dongyang &lt;Jerry87905@gmail.com&gt;
Signed-off-by: Chris Mason &lt;chris.mason@oracle.com&gt;
</content>
</entry>
<entry>
<title>Btrfs: add snapshot/subvolume destroy ioctl</title>
<updated>2009-09-21T20:00:26Z</updated>
<author>
<name>Yan, Zheng</name>
</author>
<published>2009-09-21T20:00:26Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=76dda93c6ae2c1dc3e6cde34569d6aca26b0c918'/>
<id>urn:sha1:76dda93c6ae2c1dc3e6cde34569d6aca26b0c918</id>
<content type='text'>
This patch adds snapshot/subvolume destroy ioctl.  A subvolume that isn't being
used and doesn't contains links to other subvolumes can be destroyed.

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: change how subvolumes are organized</title>
<updated>2009-09-21T19:56:00Z</updated>
<author>
<name>Yan, Zheng</name>
</author>
<published>2009-09-21T19:56:00Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=4df27c4d5cc1dda54ed7d0a8389347f2df359cf9'/>
<id>urn:sha1:4df27c4d5cc1dda54ed7d0a8389347f2df359cf9</id>
<content type='text'>
btrfs allows subvolumes and snapshots anywhere in the directory tree.
If we snapshot a subvolume that contains a link to other subvolume
called subvolA, subvolA can be accessed through both the original
subvolume and the snapshot. This is similar to creating hard link to
directory, and has the very similar problems.

The aim of this patch is enforcing there is only one access point to
each subvolume. Only the first directory entry (the one added when
the subvolume/snapshot was created) is treated as valid access point.
The first directory entry is distinguished by checking root forward
reference. If the corresponding root forward reference is missing,
we know the entry is not the first one.

This patch also adds snapshot/subvolume rename support, the code
allows rename subvolume link across subvolumes.

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: Fix checkpatch.pl warnings</title>
<updated>2009-01-06T02:25:51Z</updated>
<author>
<name>Chris Mason</name>
</author>
<published>2009-01-06T02:25:51Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d397712bcc6a759a560fd247e6053ecae091f958'/>
<id>urn:sha1:d397712bcc6a759a560fd247e6053ecae091f958</id>
<content type='text'>
There were many, most are fixed now.  struct-funcs.c generates some warnings
but these are bogus.

Signed-off-by: Chris Mason &lt;chris.mason@oracle.com&gt;
</content>
</entry>
<entry>
<title>Btrfs: make things static and include the right headers</title>
<updated>2008-12-02T14:54:17Z</updated>
<author>
<name>Christoph Hellwig</name>
</author>
<published>2008-12-02T14:54:17Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b2950863c61bc24cf0f63bc05947d9d50663c4c0'/>
<id>urn:sha1:b2950863c61bc24cf0f63bc05947d9d50663c4c0</id>
<content type='text'>
Shut up various sparse warnings about symbols that should be either
static or have their declarations in scope.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;

</content>
</entry>
<entry>
<title>Btrfs: prevent loops in the directory tree when creating snapshots</title>
<updated>2008-11-18T02:14:24Z</updated>
<author>
<name>Chris Mason</name>
</author>
<published>2008-11-18T02:14:24Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ea9e8b11bd1252dcbc23afefcf1a52ec6aa3c113'/>
<id>urn:sha1:ea9e8b11bd1252dcbc23afefcf1a52ec6aa3c113</id>
<content type='text'>
For a directory tree:

/mnt/subvolA/subvolB

btrfsctl -s /mnt/subvolA/subvolB /mnt

Will create a directory loop with subvolA under subvolB.  This
commit uses the forward refs for each subvol and snapshot to error out
before creating the loop.

Signed-off-by: Chris Mason &lt;chris.mason@oracle.com&gt;

</content>
</entry>
<entry>
<title>Btrfs: Add backrefs and forward refs for subvols and snapshots</title>
<updated>2008-11-18T01:37:39Z</updated>
<author>
<name>Chris Mason</name>
</author>
<published>2008-11-18T01:37:39Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=0660b5af3f7ac0fac69de975914e1f4a3a586fb3'/>
<id>urn:sha1:0660b5af3f7ac0fac69de975914e1f4a3a586fb3</id>
<content type='text'>
Subvols and snapshots can now be referenced from any point in the directory
tree.  We need to maintain back refs for them so we can find lost
subvols.

Forward refs are added so that we know all of the subvols and
snapshots referenced anywhere in the directory tree of a single subvol.  This
can be used to do recursive snapshotting (but they aren't yet) and it is
also used to detect and prevent directory loops when creating new snapshots.

Signed-off-by: Chris Mason &lt;chris.mason@oracle.com&gt;
</content>
</entry>
<entry>
<title>Btrfs: add and improve comments</title>
<updated>2008-09-29T19:18:18Z</updated>
<author>
<name>Chris Mason</name>
</author>
<published>2008-09-29T19:18:18Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d352ac68148b69937d39ca5d48bcc4478e118dbf'/>
<id>urn:sha1:d352ac68148b69937d39ca5d48bcc4478e118dbf</id>
<content type='text'>
This improves the comments at the top of many functions.  It didn't
dive into the guts of functions because I was trying to
avoid merging problems with the new allocator and back reference work.

extent-tree.c and volumes.c were both skipped, and there is definitely
more work todo in cleaning and commenting the code.

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