OSDN Git Service

Btrfs: make plug in writing meta blocks really work
[uclinux-h8/linux.git] / fs / btrfs / transaction.c
index f615d59..9c5f126 100644 (file)
@@ -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;
 }