Btrfs: Fix the defragmention code and the block relocation code for data=ordered

Before setting an extent to delalloc, the code needs to wait for
pending ordered extents.

Also, the relocation code needs to wait for ordered IO before scanning
the block group again.  This is because the extents are not removed
until the IO for the new extents is finished

Signed-off-by: Chris Mason <chris.mason@oracle.com>
This commit is contained in:
Chris Mason
2008-07-24 11:57:52 -04:00
parent 64f26f7450
commit 3eaa288527
6 changed files with 113 additions and 20 deletions

View File

@@ -538,6 +538,13 @@ struct btrfs_fs_info {
struct list_head dead_roots;
atomic_t nr_async_submits;
/*
* this is used by the balancing code to wait for all the pending
* ordered extents
*/
spinlock_t ordered_extent_lock;
struct list_head ordered_extents;
/*
* there is a pool of worker threads for checksumming during writes
* and a pool for checksumming after reads. This is because readers