]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: snapshot-aware defrag
authorLiu Bo <bo.li.liu@oracle.com>
Tue, 29 Jan 2013 03:18:40 +0000 (03:18 +0000)
committerChris Mason <chris.mason@fusionio.com>
Wed, 20 Feb 2013 23:06:09 +0000 (18:06 -0500)
commit051faae2bb5c03a30e4328f5fae357b9bd261d2c
treee68e689e44508cea68bf51928d864cd19f12e09d
parentc93a259638850a1c626308900a9633d818b7a636
Btrfs: snapshot-aware defrag

This comes from one of btrfs's project ideas,
As we defragment files, we break any sharing from other snapshots.
The balancing code will preserve the sharing, and defrag needs to grow this
as well.

Now we're able to fill the blank with this patch, in which we make full use of
backref walking stuff.

Here is the basic idea,
o  set the writeback ranges started by defragment with flag EXTENT_DEFRAG
o  at endio, after we finish updating fs tree, we use backref walking to find
   all parents of the ranges and re-link them with the new COWed file layout by
   adding corresponding backrefs.

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
fs/btrfs/inode.c