]> git.karo-electronics.de Git - karo-tx-linux.git/commit
Btrfs: snapshot-aware defrag
authorLiu Bo <bo.li.liu@oracle.com>
Thu, 9 Aug 2012 04:04:33 +0000 (12:04 +0800)
committerChris Mason <chris.mason@fusionio.com>
Thu, 4 Oct 2012 13:40:01 +0000 (09:40 -0400)
commitc5b8d1c05fbfad9458690aee4b5267c4f9003002
tree6a58085ae108c681281ae41b400263f172ad72db
parent7e97b8daf63487c20f78487bd4045f39b0d97cf4
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.

Originally patch by Li Zefan <lizf@cn.fujitsu.com>
Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
fs/btrfs/inode.c