Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3546434pxj; Mon, 24 May 2021 09:05:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJySuWc5N0HyL5oG8MR4erM7+n9PVrbEFrIc1JGSVJK9M2GohMTLPdkXWRw3FIlDXgMBTGRR X-Received: by 2002:a5d:89ce:: with SMTP id a14mr13801825iot.82.1621872352249; Mon, 24 May 2021 09:05:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621872352; cv=none; d=google.com; s=arc-20160816; b=N7KzPx0cVRaRLp11i7ju0IY9hXjFAhdu67NTGvMcht14K639DmbqassNMBc6H3HNrT FrRfmW5Hv1mhftLY/UVF2m0g9Oxidy8gpVAfyEqsr409zoqUyDSrdq2A43mgLWb3vQO8 SLvxePvQmy1foUEdSw2Nfnj6ms4QnmNL30lpREuQ+Ipj2Si9XoTN5/nSSy0FCCNjZUVN VL/Tl6awJOz4jYqgjQcIR1FAMtm+mf3chKxjKwipKsAnH9Bx2ycNKR++7cJ96D6WYjav bLnGx+1fpxWVwLNX44bX5vcIPpBR9hJaqzilwkD8lGstZxi6vgO3VyZgnE0eYlKLlf2u 2ypA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ZamhpNUIbaW65BZLt1Qy9lOcpY4dWmlh2CfsIph3TUY=; b=QytChbh/VCRQLKpw+6Q7I+RqLcYiVL1ID2BDOt81HWwKB02WN+EePqJZJ5l5FN/yqE zGodpfDl5aPsDTYYnq/niF4S4oTE4iwC9X17QJalh5ytqtYD4qWD0HbUkNWQQkovGhW4 As503OeJFM8s0N2F0FFoqys0Z7cUy6XkaJnr/MOxFRO5L+miOZdNvcVVqoYzkaVkPxtl M5a/6QZMu2I4t4KJo3uKcNxit88KIutWRUzHtXKcJVh92rg26aiIFsS8nYk9p2UJwPK0 MYHmpHpdfNSo+3eeeEL9ia7J2z0Z+14QHqClsPNk6j4Z0KzcrljmrcQWyu1uqr9O0jhx G93Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=jBa+YopG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g8si14357205ilk.127.2021.05.24.09.05.33; Mon, 24 May 2021 09:05:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=jBa+YopG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236605AbhEXQEc (ORCPT + 99 others); Mon, 24 May 2021 12:04:32 -0400 Received: from mail.kernel.org ([198.145.29.99]:40480 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234527AbhEXP5z (ORCPT ); Mon, 24 May 2021 11:57:55 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 686486138C; Mon, 24 May 2021 15:43:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621871024; bh=D131zHAiby8X8SHnX+LhTQ0lsA8n00mVrFDGhRW5LDw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jBa+YopGQ55wB9jp2dx/Tv8NXhYxwB3NqMlMIbkoWFOrAcjnOb+Pb8iYxTNGkeANK 0Sy/xR3ONQmzxW8MULO4GQRBi7PrOJlD+doFOV2mEpilJEHZOjYfgpEYEY/OPcJr6Z DnsF+LIDuvhKCSeodUketvrbMnci9EhkglDmx4zw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Johannes Thumshirn , David Sterba Subject: [PATCH 5.12 037/127] btrfs: zoned: pass start block to btrfs_use_zone_append Date: Mon, 24 May 2021 17:25:54 +0200 Message-Id: <20210524152336.106395864@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210524152334.857620285@linuxfoundation.org> References: <20210524152334.857620285@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Johannes Thumshirn commit e380adfc213a13677993c0e35cb48f5a8e61ebb0 upstream. btrfs_use_zone_append only needs the passed in extent_map's block_start member, so there's no need to pass in the full extent map. This also enables the use of btrfs_use_zone_append in places where we only have a start byte but no extent_map. Signed-off-by: Johannes Thumshirn Reviewed-by: David Sterba Signed-off-by: David Sterba Signed-off-by: Greg Kroah-Hartman --- fs/btrfs/extent_io.c | 2 +- fs/btrfs/inode.c | 2 +- fs/btrfs/zoned.c | 4 ++-- fs/btrfs/zoned.h | 5 ++--- 4 files changed, 6 insertions(+), 7 deletions(-) --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c @@ -3762,7 +3762,7 @@ static noinline_for_stack int __extent_w /* Note that em_end from extent_map_end() is exclusive */ iosize = min(em_end, end + 1) - cur; - if (btrfs_use_zone_append(inode, em)) + if (btrfs_use_zone_append(inode, em->block_start)) opf = REQ_OP_ZONE_APPEND; free_extent_map(em); --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -7782,7 +7782,7 @@ static int btrfs_dio_iomap_begin(struct iomap->bdev = fs_info->fs_devices->latest_bdev; iomap->length = len; - if (write && btrfs_use_zone_append(BTRFS_I(inode), em)) + if (write && btrfs_use_zone_append(BTRFS_I(inode), em->block_start)) iomap->flags |= IOMAP_F_ZONE_APPEND; free_extent_map(em); --- a/fs/btrfs/zoned.c +++ b/fs/btrfs/zoned.c @@ -1278,7 +1278,7 @@ void btrfs_free_redirty_list(struct btrf spin_unlock(&trans->releasing_ebs_lock); } -bool btrfs_use_zone_append(struct btrfs_inode *inode, struct extent_map *em) +bool btrfs_use_zone_append(struct btrfs_inode *inode, u64 start) { struct btrfs_fs_info *fs_info = inode->root->fs_info; struct btrfs_block_group *cache; @@ -1293,7 +1293,7 @@ bool btrfs_use_zone_append(struct btrfs_ if (!is_data_inode(&inode->vfs_inode)) return false; - cache = btrfs_lookup_block_group(fs_info, em->block_start); + cache = btrfs_lookup_block_group(fs_info, start); ASSERT(cache); if (!cache) return false; --- a/fs/btrfs/zoned.h +++ b/fs/btrfs/zoned.h @@ -47,7 +47,7 @@ void btrfs_calc_zone_unusable(struct btr void btrfs_redirty_list_add(struct btrfs_transaction *trans, struct extent_buffer *eb); void btrfs_free_redirty_list(struct btrfs_transaction *trans); -bool btrfs_use_zone_append(struct btrfs_inode *inode, struct extent_map *em); +bool btrfs_use_zone_append(struct btrfs_inode *inode, u64 start); void btrfs_record_physical_zoned(struct inode *inode, u64 file_offset, struct bio *bio); void btrfs_rewrite_logical_zoned(struct btrfs_ordered_extent *ordered); @@ -146,8 +146,7 @@ static inline void btrfs_redirty_list_ad struct extent_buffer *eb) { } static inline void btrfs_free_redirty_list(struct btrfs_transaction *trans) { } -static inline bool btrfs_use_zone_append(struct btrfs_inode *inode, - struct extent_map *em) +static inline bool btrfs_use_zone_append(struct btrfs_inode *inode, u64 start) { return false; }