diff options
author | Chris Mason <chris.mason@oracle.com> | 2007-09-11 17:15:39 +0200 |
---|---|---|
committer | David Woodhouse <dwmw2@hera.kernel.org> | 2007-09-11 17:15:39 +0200 |
commit | 5ce14bbcdd1b5d9233d26a1e89faf3a26c820c58 (patch) | |
tree | 6e2a2964e9b01c03dd1b4d58c976d76664747b64 /fs/btrfs/transaction.h | |
parent | Btrfs: [PATCH] extent_map: add writepage_end_io hook (diff) | |
download | linux-5ce14bbcdd1b5d9233d26a1e89faf3a26c820c58.tar.xz linux-5ce14bbcdd1b5d9233d26a1e89faf3a26c820c58.zip |
Btrfs: Find and remove dead roots the first time a root is loaded.
Dead roots are trees left over after a crash, and they were either in the
process of being removed or were waiting to be removed when the box crashed.
Before, a search of the entire tree of root pointers was done on mount
looking for dead roots. Now, the search is done the first time we load
a root.
This makes mount faster when there are a large number of snapshots, and it
enables the block accounting code to properly update the block counts on
the latest root as old versions of the root are reaped after a crash.
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/transaction.h')
-rw-r--r-- | fs/btrfs/transaction.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/btrfs/transaction.h b/fs/btrfs/transaction.h index e451783a1a4d..4bc328cbb24c 100644 --- a/fs/btrfs/transaction.h +++ b/fs/btrfs/transaction.h @@ -78,7 +78,8 @@ void btrfs_transaction_flush_work(struct btrfs_root *root); void btrfs_transaction_queue_work(struct btrfs_root *root, int delay); void btrfs_init_transaction_sys(void); void btrfs_exit_transaction_sys(void); -int btrfs_add_dead_root(struct btrfs_root *root, struct list_head *dead_list); +int btrfs_add_dead_root(struct btrfs_root *root, struct btrfs_root *latest, + struct list_head *dead_list); int btrfs_defrag_dirty_roots(struct btrfs_fs_info *info); int btrfs_defrag_root(struct btrfs_root *root, int cacheonly); int btrfs_clean_old_snapshots(struct btrfs_root *root); |