diff options
author | Josef Bacik <jbacik@fb.com> | 2014-11-17 15:45:48 -0500 |
---|---|---|
committer | Chris Mason <clm@fb.com> | 2015-01-21 17:36:52 -0800 |
commit | ce93ec548cfa02f9cd6b70d546d5f36f4d160f57 (patch) | |
tree | b6274b12d55c6ed97d3ad508e2cb5c428d74df30 /fs/btrfs/transaction.h | |
parent | e7070be198b34c26f39bd9010a29ce6462dc4f3e (diff) | |
download | linux-ce93ec548cfa02f9cd6b70d546d5f36f4d160f57.tar.bz2 |
Btrfs: track dirty block groups on their own list
Currently any time we try to update the block groups on disk we will walk _all_
block groups and check for the ->dirty flag to see if it is set. This function
can get called several times during a commit. So if you have several terabytes
of data you will be a very sad panda as we will loop through _all_ of the block
groups several times, which makes the commit take a while which slows down the
rest of the file system operations.
This patch introduces a dirty list for the block groups that we get added to
when we dirty the block group for the first time. Then we simply update any
block groups that have been dirtied since the last time we called
btrfs_write_dirty_block_groups. This allows us to clean up how we write the
free space cache out so it is much cleaner. Thanks,
Signed-off-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: Chris Mason <clm@fb.com>
Diffstat (limited to 'fs/btrfs/transaction.h')
-rw-r--r-- | fs/btrfs/transaction.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/btrfs/transaction.h b/fs/btrfs/transaction.h index 00ed29c4b3f9..3305451451ca 100644 --- a/fs/btrfs/transaction.h +++ b/fs/btrfs/transaction.h @@ -58,6 +58,8 @@ struct btrfs_transaction { struct list_head pending_chunks; struct list_head pending_ordered; struct list_head switch_commits; + struct list_head dirty_bgs; + spinlock_t dirty_bgs_lock; struct btrfs_delayed_ref_root delayed_refs; int aborted; }; |