From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.6 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AE4B2C433DB for ; Tue, 19 Jan 2021 00:29:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 78A07230FF for ; Tue, 19 Jan 2021 00:29:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732730AbhASA3h (ORCPT ); Mon, 18 Jan 2021 19:29:37 -0500 Received: from userp2130.oracle.com ([156.151.31.86]:56114 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730466AbhASA3e (ORCPT ); Mon, 18 Jan 2021 19:29:34 -0500 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 10J0FU5n168357; Tue, 19 Jan 2021 00:28:37 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : to : cc : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=corp-2020-01-29; bh=2ao4MDsp9rAiFU5VVLiQKoMbqbNy+6VSRgxjFTFpfm0=; b=CXpAPQDQvmEFuXyUwTY54YwH7UfNZYOpKhTgNxWW9phfEdIfXz6ZpN+gvX8akbI82+4k 893+MFl8PWfoSvAbVijFmOAgvIqBVP+fgctR0+PjiWLrXSFXLyoWyKNKO6dsdLAbvarm OHUTByHA8RO8f4KkZ0VbFF/nSzPMLd8sUBj9cCw3Zq0UfxYhoggGOUm//YylKDhRojb/ vgasZ2lQpQcMeZ74VBfFwtm8t2akoADY3rGgPkepsRAP0E9gg2QZarHE8ZmesUHvnYSH RhoRuKhqEcD0zmv5pbP1OrUhr+dxTDXRu7Apfq7WghqDzAv5T5jerpYVN0+w4veYYWTn 3w== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by userp2130.oracle.com with ESMTP id 363xyhpae7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 19 Jan 2021 00:28:37 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 10J0EtD1169971; Tue, 19 Jan 2021 00:28:36 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userp3020.oracle.com with ESMTP id 3649wqk5h7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 19 Jan 2021 00:28:36 +0000 Received: from abhmp0001.oracle.com (abhmp0001.oracle.com [141.146.116.7]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id 10J0SYm5024413; Tue, 19 Jan 2021 00:28:34 GMT Received: from [192.168.10.137] (/39.109.186.25) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 18 Jan 2021 16:28:34 -0800 Subject: Re: [PATCH v12 08/41] btrfs: allow zoned mode on non-zoned block devices To: Naohiro Aota , Josef Bacik Cc: linux-btrfs@vger.kernel.org, dsterba@suse.com, hare@suse.com, linux-fsdevel@vger.kernel.org, Jens Axboe , Christoph Hellwig , "Darrick J. Wong" , Johannes Thumshirn References: <20210118141555.lljrdbuhok4y4d23@naota.dhcp.fujisawa.hgst.com> From: Anand Jain Message-ID: Date: Tue, 19 Jan 2021 08:28:29 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.6.1 MIME-Version: 1.0 In-Reply-To: <20210118141555.lljrdbuhok4y4d23@naota.dhcp.fujisawa.hgst.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9868 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 mlxlogscore=999 bulkscore=0 spamscore=0 phishscore=0 malwarescore=0 adultscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2101190000 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9868 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 phishscore=0 malwarescore=0 mlxlogscore=999 bulkscore=0 priorityscore=1501 spamscore=0 mlxscore=0 impostorscore=0 lowpriorityscore=0 suspectscore=0 clxscore=1011 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2101190000 Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org On 18/1/21 10:15 pm, Naohiro Aota wrote: > On Fri, Jan 15, 2021 at 05:07:26PM -0500, Josef Bacik wrote: >> On 1/15/21 1:53 AM, Naohiro Aota wrote: >>> From: Johannes Thumshirn >>> >>> Run zoned btrfs mode on non-zoned devices. This is done by "slicing >>> up" the block-device into static sized chunks and fake a conventional >>> zone >>> on each of them. The emulated zone size is determined from the size of >>> device extent. >>> >>> This is mainly aimed at testing parts of the zoned mode, i.e. the zoned >>> chunk allocator, on regular block devices. >>> >>> Signed-off-by: Johannes Thumshirn >>> Signed-off-by: Naohiro Aota >>> --- >>>  fs/btrfs/zoned.c | 149 +++++++++++++++++++++++++++++++++++++++++++---- >>>  fs/btrfs/zoned.h |  14 +++-- >>>  2 files changed, 147 insertions(+), 16 deletions(-) >>> >>> diff --git a/fs/btrfs/zoned.c b/fs/btrfs/zoned.c >>> index 684dad749a8c..13b240e5db4e 100644 >>> --- a/fs/btrfs/zoned.c >>> +++ b/fs/btrfs/zoned.c >>> @@ -119,6 +119,37 @@ static inline u32 sb_zone_number(int shift, int >>> mirror) >>>      return 0; >>>  } >>> +/* >>> + * Emulate blkdev_report_zones() for a non-zoned device. It slice up >>> + * the block device into static sized chunks and fake a conventional >>> zone >>> + * on each of them. >>> + */ >>> +static int emulate_report_zones(struct btrfs_device *device, u64 pos, >>> +                struct blk_zone *zones, unsigned int nr_zones) >>> +{ >>> +    const sector_t zone_sectors = >>> +        device->fs_info->zone_size >> SECTOR_SHIFT; >>> +    sector_t bdev_size = device->bdev->bd_part->nr_sects; >> >> This needs to be changed to bdev_nr_sectors(), it fails to compile on >> misc-next.  This patch also fails to apply to misc-next as well. Thanks, >> >> Josef > > Oh, I'll rebase on the latest misc-next and fix them all in v13. Thanks. Patch 12 was conflicting in zone.c which was due to line number changes, and again I was stuck with the patch 19 due to conflicts. I will wait for v13. Thanks, Anand