diff options
author | Chris Mason <chris.mason@oracle.com> | 2009-04-20 15:50:09 -0400 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2009-04-20 15:53:08 -0400 |
commit | ffbd517d5a8c8e93ddd11046434fb029f3df73aa (patch) | |
tree | 9ec7b7f2efbb8950ca2654235a899398e82a68b5 /fs/btrfs/volumes.h | |
parent | 0882e8dd3aad33eca41696d463bb896e6c8817eb (diff) | |
download | linux-ffbd517d5a8c8e93ddd11046434fb029f3df73aa.tar.bz2 |
Btrfs: use WRITE_SYNC for synchronous writes
Part of reducing fsync/O_SYNC/O_DIRECT latencies is using WRITE_SYNC for
writes we plan on waiting on in the near future. This patch
mirrors recent changes in other filesystems and the generic code to
use WRITE_SYNC when WB_SYNC_ALL is passed and to use WRITE_SYNC for
other latency critical writes.
Btrfs uses async worker threads for checksumming before the write is done,
and then again to actually submit the bios. The bio submission code just
runs a per-device list of bios that need to be sent down the pipe.
This list is split into low priority and high priority lists so the
WRITE_SYNC IO happens first.
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/volumes.h')
-rw-r--r-- | fs/btrfs/volumes.h | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/fs/btrfs/volumes.h b/fs/btrfs/volumes.h index 2185de72ff7d..5836327ba5dd 100644 --- a/fs/btrfs/volumes.h +++ b/fs/btrfs/volumes.h @@ -23,13 +23,22 @@ #include "async-thread.h" struct buffer_head; +struct btrfs_pending_bios { + struct bio *head; + struct bio *tail; +}; + struct btrfs_device { struct list_head dev_list; struct list_head dev_alloc_list; struct btrfs_fs_devices *fs_devices; struct btrfs_root *dev_root; - struct bio *pending_bios; - struct bio *pending_bio_tail; + + /* regular prio bios */ + struct btrfs_pending_bios pending_bios; + /* WRITE_SYNC bios */ + struct btrfs_pending_bios pending_sync_bios; + int running_pending; u64 generation; |