diff options
author | Chris Mason <chris.mason@oracle.com> | 2008-07-24 11:57:52 -0400 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2008-09-25 11:04:05 -0400 |
commit | 3eaa2885276fd6dac7b076a793932428b7168e74 (patch) | |
tree | b06382bec68bf1755597a74ac8225f3bcddda5e5 /fs/btrfs/ctree.h | |
parent | 64f26f745084872b916cd1bef6054e21b15c5784 (diff) | |
download | lwn-3eaa2885276fd6dac7b076a793932428b7168e74.tar.gz lwn-3eaa2885276fd6dac7b076a793932428b7168e74.zip |
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>
Diffstat (limited to 'fs/btrfs/ctree.h')
-rw-r--r-- | fs/btrfs/ctree.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h index 8ecac2e77a43..6675e916ebcd 100644 --- a/fs/btrfs/ctree.h +++ b/fs/btrfs/ctree.h @@ -539,6 +539,13 @@ struct btrfs_fs_info { 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 * can run with FS locks held, and the writers may be waiting for |