Commit 2adada88 authored by Johannes Thumshirn's avatar Johannes Thumshirn Committed by David Sterba

btrfs: check for relocation inodes on zoned btrfs in should_nocow

Prepare for allowing preallocation for relocation inodes.
Reviewed-by: default avatarNaohiro Aota <naohiro.aota@wdc.com>
Signed-off-by: default avatarJohannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent e6d261e3
......@@ -1944,7 +1944,15 @@ int btrfs_run_delalloc_range(struct btrfs_inode *inode, struct page *locked_page
const bool zoned = btrfs_is_zoned(inode->root->fs_info);
if (should_nocow(inode, start, end)) {
ASSERT(!zoned);
/*
* Normally on a zoned device we're only doing COW writes, but
* in case of relocation on a zoned filesystem we have taken
* precaution, that we're only writing sequentially. It's safe
* to use run_delalloc_nocow() here, like for regular
* preallocated inodes.
*/
ASSERT(!zoned ||
(zoned && btrfs_is_data_reloc_root(inode->root)));
ret = run_delalloc_nocow(inode, locked_page, start, end,
page_started, nr_written);
} else if (!inode_can_compress(inode) ||
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment