]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: speed up snapshot dropping
authorYan, Zheng <zheng.yan@oracle.com>
Mon, 21 Sep 2009 19:55:59 +0000 (15:55 -0400)
committerChris Mason <chris.mason@oracle.com>
Mon, 21 Sep 2009 19:55:59 +0000 (15:55 -0400)
commit73d36db8cfa1b8ffb598aed7b92ea3e4b7e75307
treeaeccbf3495421d1343bbe08cb824ac1ae6764e43
parent368e8e975686a1048b5142df5713801c14da0fa9
Btrfs: speed up snapshot dropping

This patch contains two changes to avoid unnecessary tree block reads during
snapshot dropping.

First, check tree block's reference count and flags before reading the tree
block. if reference count > 1 and there is no need to update backrefs, we can
avoid reading the tree block.

Second, save when snapshot was created in root_key.offset. we can compare block
pointer's generation with snapshot's creation generation during updating
backrefs. If a given block was created before snapshot was created, the
snapshot can't be the tree block's owner. So we can avoid reading the block.

Signed-off-by: Yan Zheng <zheng.yan@oracle.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
fs/btrfs/extent-tree.c
fs/btrfs/transaction.c