diff mbox series

[3/6] btrfs: zoned: use regular writes for relocation

Message ID ac0fb08cbaada419c4e7a65a78793401ac557e55.1630679569.git.johannes.thumshirn@wdc.com (mailing list archive)
State New, archived
Headers show
Series btrfs: zoned: unify relocation on a zoned and regular FS | expand

Commit Message

Johannes Thumshirn Sept. 3, 2021, 2:44 p.m. UTC
Now that we have a dedicated block group for relocation, we can use
REQ_OP_WRITE instead of  REQ_OP_ZONE_APPEND for writing out the data on
relocation.

Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
---
 fs/btrfs/zoned.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Naohiro Aota Sept. 7, 2021, 11:39 a.m. UTC | #1
On Fri, Sep 03, 2021 at 11:44:44PM +0900, Johannes Thumshirn wrote:
> Now that we have a dedicated block group for relocation, we can use
> REQ_OP_WRITE instead of  REQ_OP_ZONE_APPEND for writing out the data on
> relocation.
> 
> Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
> ---
>  fs/btrfs/zoned.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/fs/btrfs/zoned.c b/fs/btrfs/zoned.c
> index 28a06c2d80ad..be82823c9b16 100644
> --- a/fs/btrfs/zoned.c
> +++ b/fs/btrfs/zoned.c
> @@ -1490,6 +1490,9 @@ bool btrfs_use_zone_append(struct btrfs_inode *inode, u64 start)
>  	if (!is_data_inode(&inode->vfs_inode))
>  		return false;
>  
> +	if (btrfs_is_data_reloc_root(inode->root))
> +		return false;
> +

Not using zone append for data relocation is not straight forward. So,
I'd like to have a comment why we need to use WRITE here.

Apart from that looks good,
Reviewed-by: Naohiro Aota <naohiro.aota@wdc.com>

>  	cache = btrfs_lookup_block_group(fs_info, start);
>  	ASSERT(cache);
>  	if (!cache)
> -- 
> 2.32.0
>
diff mbox series

Patch

diff --git a/fs/btrfs/zoned.c b/fs/btrfs/zoned.c
index 28a06c2d80ad..be82823c9b16 100644
--- a/fs/btrfs/zoned.c
+++ b/fs/btrfs/zoned.c
@@ -1490,6 +1490,9 @@  bool btrfs_use_zone_append(struct btrfs_inode *inode, u64 start)
 	if (!is_data_inode(&inode->vfs_inode))
 		return false;
 
+	if (btrfs_is_data_reloc_root(inode->root))
+		return false;
+
 	cache = btrfs_lookup_block_group(fs_info, start);
 	ASSERT(cache);
 	if (!cache)