From: Yan, Zheng Date: Mon, 21 Sep 2009 19:55:59 +0000 (-0400) Subject: Btrfs: speed up snapshot dropping X-Git-Tag: v2.6.32-rc1~57^2^2~19 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1c4850e21df8b441164d910bc611ef46a01d5d75;p=pandora-kernel.git 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 Signed-off-by: Chris Mason --- Reading git-diff-tree failed