diff options
author | Nikolay Borisov <nborisov@suse.com> | 2018-11-08 09:18:06 +0100 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2018-12-17 14:51:32 +0100 |
commit | 7789a55aa1c98e3408a77167699f86fdb79f097b (patch) | |
tree | 913ca5e354fe000997219acbdeb63b639979173e /fs/btrfs/extent_io.c | |
parent | btrfs: Check for missing device before bio submission in btrfs_map_bio (diff) | |
download | linux-7789a55aa1c98e3408a77167699f86fdb79f097b.tar.xz linux-7789a55aa1c98e3408a77167699f86fdb79f097b.zip |
btrfs: Move epd::extent_locked check to writepage_delalloc's caller
If epd::extent_locked is set then writepage_delalloc terminates. Make
this a bit more apparent in the caller by simply bubbling the check up.
This enables to remove epd as an argument to writepage_delalloc in a
future patch. No functional change.
Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/extent_io.c')
-rw-r--r-- | fs/btrfs/extent_io.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index e7cbd3f98404..2ccc8d93d93e 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c @@ -3214,8 +3214,6 @@ static noinline_for_stack int writepage_delalloc(struct inode *inode, int ret; int page_started = 0; - if (epd->extent_locked) - return 0; while (delalloc_end < page_end) { nr_delalloc = find_lock_delalloc_range(inode, tree, @@ -3471,11 +3469,14 @@ static int __extent_writepage(struct page *page, struct writeback_control *wbc, set_page_extent_mapped(page); - ret = writepage_delalloc(inode, page, wbc, epd, start, &nr_written); - if (ret == 1) - goto done_unlocked; - if (ret) - goto done; + if (!epd->extent_locked) { + ret = writepage_delalloc(inode, page, wbc, epd, start, + &nr_written); + if (ret == 1) + goto done_unlocked; + if (ret) + goto done; + } ret = __extent_writepage_io(inode, page, wbc, epd, i_size, nr_written, write_flags, &nr); |