diff options
author | Liu Bo <bo.li.liu@oracle.com> | 2017-08-21 15:49:59 -0600 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2017-10-30 12:27:56 +0100 |
commit | 6300463b14c1c2665674eb8f15843e5bb7a7ff84 (patch) | |
tree | 060ae6e6932378afd53206a3be39266194d4003c /fs/btrfs/transaction.c | |
parent | d8953d69bca83fab616f37693152384cea49f964 (diff) | |
download | linux-stable-6300463b14c1c2665674eb8f15843e5bb7a7ff84.tar.gz linux-stable-6300463b14c1c2665674eb8f15843e5bb7a7ff84.tar.bz2 linux-stable-6300463b14c1c2665674eb8f15843e5bb7a7ff84.zip |
Btrfs: make plug in writing meta blocks really work
We have started plug in btrfs_write_and_wait_marked_extents() but the
generated IOs actually go to device's schedule IO list where the work
is doing in another task, thus the started plug doesn't make any
sense.
And since we wait for IOs immediately after writing meta blocks, it's
the same case as writing log tree, doing sync submit can merge more
IOs.
Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/transaction.c')
-rw-r--r-- | fs/btrfs/transaction.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c index f615d59b0489..9c5f126064bd 100644 --- a/fs/btrfs/transaction.c +++ b/fs/btrfs/transaction.c @@ -950,6 +950,7 @@ int btrfs_write_marked_extents(struct btrfs_fs_info *fs_info, u64 start = 0; u64 end; + atomic_inc(&BTRFS_I(fs_info->btree_inode)->sync_writers); while (!find_first_extent_bit(dirty_pages, start, &start, &end, mark, &cached_state)) { bool wait_writeback = false; @@ -985,6 +986,7 @@ int btrfs_write_marked_extents(struct btrfs_fs_info *fs_info, cond_resched(); start = end + 1; } + atomic_dec(&BTRFS_I(fs_info->btree_inode)->sync_writers); return werr; } |