diff options
author | Chris Mason <chris.mason@oracle.com> | 2008-07-17 12:53:50 -0400 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2008-09-25 11:04:04 -0400 |
commit | e6dcd2dc9c489108648e2ed543315dd134d50a9a (patch) | |
tree | cddf6f588b65e28c5feb8bff89b22d8ff70f8a50 /fs/btrfs/btrfs_inode.h | |
parent | 77a41afb7d0dd0f27b6f2f1a5bc701929c7034de (diff) |
Btrfs: New data=ordered implementation
The old data=ordered code would force commit to wait until
all the data extents from the transaction were fully on disk. This
introduced large latencies into the commit and stalled new writers
in the transaction for a long time.
The new code changes the way data allocations and extents work:
* When delayed allocation is filled, data extents are reserved, and
the extent bit EXTENT_ORDERED is set on the entire range of the extent.
A struct btrfs_ordered_extent is allocated an inserted into a per-inode
rbtree to track the pending extents.
* As each page is written EXTENT_ORDERED is cleared on the bytes corresponding
to that page.
* When all of the bytes corresponding to a single struct btrfs_ordered_extent
are written, The previously reserved extent is inserted into the FS
btree and into the extent allocation trees. The checksums for the file
data are also updated.
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/btrfs_inode.h')
-rw-r--r-- | fs/btrfs/btrfs_inode.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/btrfs/btrfs_inode.h b/fs/btrfs/btrfs_inode.h index 40b4e0c9cd09..8d03687510e0 100644 --- a/fs/btrfs/btrfs_inode.h +++ b/fs/btrfs/btrfs_inode.h | |||
@@ -21,6 +21,7 @@ | |||
21 | 21 | ||
22 | #include "extent_map.h" | 22 | #include "extent_map.h" |
23 | #include "extent_io.h" | 23 | #include "extent_io.h" |
24 | #include "ordered-data.h" | ||
24 | 25 | ||
25 | /* in memory btrfs inode */ | 26 | /* in memory btrfs inode */ |
26 | struct btrfs_inode { | 27 | struct btrfs_inode { |
@@ -32,9 +33,8 @@ struct btrfs_inode { | |||
32 | struct extent_io_tree io_failure_tree; | 33 | struct extent_io_tree io_failure_tree; |
33 | struct mutex csum_mutex; | 34 | struct mutex csum_mutex; |
34 | struct inode vfs_inode; | 35 | struct inode vfs_inode; |
35 | atomic_t ordered_writeback; | 36 | struct btrfs_ordered_inode_tree ordered_tree; |
36 | 37 | ||
37 | u64 ordered_trans; | ||
38 | /* | 38 | /* |
39 | * transid of the trans_handle that last modified this inode | 39 | * transid of the trans_handle that last modified this inode |
40 | */ | 40 | */ |