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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 679A8C433EF for ; Wed, 27 Apr 2022 23:39:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233491AbiD0Xmt (ORCPT ); Wed, 27 Apr 2022 19:42:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41910 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233033AbiD0Xmr (ORCPT ); Wed, 27 Apr 2022 19:42:47 -0400 Received: from esa6.hgst.iphmx.com (esa6.hgst.iphmx.com [216.71.154.45]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AC4205F26B for ; Wed, 27 Apr 2022 16:39:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1651102775; x=1682638775; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=MKuYv4XGK8HdnYkTj9llLnq6WFfSVxaVrJlMmCv+wiQ=; b=CTuUkQPqWF1SwXjcvk/8fJWMxJW2+NqL6kXoBMqGCa55EVTzcO1jtvKZ xjOsGKhGHXmyzRMgHE9lu4jDk6sndYVcA9WL1ReH8HazNmqjpZPi4fBIM Wtn9WzBaKbanppT9bLtD2z1vx9xs3o24mZKB0fNkkX7dY/7cBJrnz1IEy SPF+CIp1r/qW5jaERM+JBIRq7yWMG82QWBUwWhgVt9Tj/UU708A0RHlCC l/uGtcoqnIpywH/e3bnVlddjCbrRxUUMolQxPkz1hy0pZT9/Ykj3BOkSy JIZSQPm+tLSQJuJmiYae0guMqjcjvyT9Q8XxzbQ2iFkSY7y80DlqrTT4E A==; X-IronPort-AV: E=Sophos;i="5.90,294,1643644800"; d="scan'208";a="199893626" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 28 Apr 2022 07:39:33 +0800 IronPort-SDR: hMXUh/N6ma7RM56UdsjeUloYr9gpMBSQPRUbGQVwz4IdXx71/hzGoCUcaTa7yV3+TA/G5xAmHX pvEGekfPZ8jqP8ulvVgwC3Agh4exPq18x0kXLMvaNtMq7t9/0ZOgj4Z0JUtlZYeV66Vzj6M6Ty IOyQg5u06B7ABA+pUsposnoGyksQZcSr/8TyqO9OYJAgRObAxLyNWLD4pEnX7lI0015goe3p6u xq1C91ZkoL0KZn3il+2YZakm747DzFjW+vjYoJR9621I6Y0/l8Dw3AOJJQ2KkKEfxxntjHf2To lrHRxrAnhVCjZ7n96XgFTEBw Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 27 Apr 2022 16:10:25 -0700 IronPort-SDR: X8G5/xOHjNjAqnwl4H+skj8WL2OI5fodSJFj8atxgj9Ar7LkuqwFfYXfXFYZ5r63mjz/sCv8NO 3oRXCdsxu6s4/1zYU+9zQcHzkXD4JVvclV8BrDMW+cGBRmmnlYfTYR7DMl8Xb4AoAidy3hLVbi w5kMrU6Z0zIXZzXDImPtZCPj0sqDZkolnJe/quXmXzsxXvp5fpyJz1j2L3Vrcjl7/lmsXCctZ6 Ot+YMFLoS+tBDkl5opcP6F0o5nbhlnPGpFyORMkE0iUS3MNI2JH06CCwU8WndB1E1cEj99iBp2 2SI= WDCIronportException: Internal Received: from usg-ed-osssrv.wdc.com ([10.3.10.180]) by uls-op-cesaip01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 27 Apr 2022 16:39:33 -0700 Received: from usg-ed-osssrv.wdc.com (usg-ed-osssrv.wdc.com [127.0.0.1]) by usg-ed-osssrv.wdc.com (Postfix) with ESMTP id 4KpZwN0YB8z1SVp4 for ; Wed, 27 Apr 2022 16:39:32 -0700 (PDT) Authentication-Results: usg-ed-osssrv.wdc.com (amavisd-new); dkim=pass reason="pass (just generated, assumed good)" header.d=opensource.wdc.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d= opensource.wdc.com; h=content-transfer-encoding:content-type :in-reply-to:organization:from:references:to:content-language :subject:user-agent:mime-version:date:message-id; s=dkim; t= 1651102770; x=1653694771; bh=MKuYv4XGK8HdnYkTj9llLnq6WFfSVxaVrJl MmCv+wiQ=; b=F5aK313D/33i58L2HhyWZlmIYLxYFRau6pifLJL1hYJrhXiCZ8a QUlDThdd2S3jmMYxAnQGrk3uOInkmqWWXkmRW3ymLN1LfKOS5+bY79RzMlQL1w3p byr+W7KlfQmvdAdTOFjqy4Bvd6pxExnVEQWWyxoWm8P74hjVHX/Vm9LlwbazeVIZ wJ7tVTr0brCKfrteamJp89kRredPxEKv83eWrlHtbe+v5l92MU36wBYsIEFDv/Kv dXViO7aRNsJw2ghY9ipJqj+m8Fo9xYv4zTR8q40gyecTBz59xhum1EvNku7fAoNM dMuWLLgJcGyyRSZREN2s2w7PK2MFxbc5f1g== X-Virus-Scanned: amavisd-new at usg-ed-osssrv.wdc.com Received: from usg-ed-osssrv.wdc.com ([127.0.0.1]) by usg-ed-osssrv.wdc.com (usg-ed-osssrv.wdc.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id vCjQ3ASviE4y for ; Wed, 27 Apr 2022 16:39:30 -0700 (PDT) Received: from [10.225.163.27] (unknown [10.225.163.27]) by usg-ed-osssrv.wdc.com (Postfix) with ESMTPSA id 4KpZwF5hMDz1Rvlc; Wed, 27 Apr 2022 16:39:25 -0700 (PDT) Message-ID: Date: Thu, 28 Apr 2022 08:39:24 +0900 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0 Subject: Re: [PATCH 12/16] zonefs: allow non power of 2 zoned devices Content-Language: en-US To: Pankaj Raghav , jaegeuk@kernel.org, axboe@kernel.dk, snitzer@kernel.org, hch@lst.de, mcgrof@kernel.org, naohiro.aota@wdc.com, sagi@grimberg.me, dsterba@suse.com, johannes.thumshirn@wdc.com Cc: linux-kernel@vger.kernel.org, linux-btrfs@vger.kernel.org, clm@fb.com, gost.dev@samsung.com, chao@kernel.org, linux-f2fs-devel@lists.sourceforge.net, josef@toxicpanda.com, jonathan.derrick@linux.dev, agk@redhat.com, kbusch@kernel.org, kch@nvidia.com, linux-nvme@lists.infradead.org, dm-devel@redhat.com, bvanassche@acm.org, jiangbo.365@bytedance.com, linux-fsdevel@vger.kernel.org, matias.bjorling@wdc.com, linux-block@vger.kernel.org References: <20220427160255.300418-1-p.raghav@samsung.com> <20220427160255.300418-13-p.raghav@samsung.com> From: Damien Le Moal Organization: Western Digital Research In-Reply-To: <20220427160255.300418-13-p.raghav@samsung.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org On 4/28/22 01:02, Pankaj Raghav wrote: > The zone size shift variable is useful only if the zone sizes are known > to be power of 2. Remove that variable and use generic helpers from > block layer to calculate zone index in zonefs Period missing at the end of the sentence. What about zonefs-tools and its test suite ? Is everything still OK on that front ? I suspect not... > > Reviewed-by: Luis Chamberlain > Signed-off-by: Pankaj Raghav > --- > fs/zonefs/super.c | 6 ++---- > fs/zonefs/zonefs.h | 1 - > 2 files changed, 2 insertions(+), 5 deletions(-) > > diff --git a/fs/zonefs/super.c b/fs/zonefs/super.c > index 3614c7834007..5422be2ca570 100644 > --- a/fs/zonefs/super.c > +++ b/fs/zonefs/super.c > @@ -401,10 +401,9 @@ static void __zonefs_io_error(struct inode *inode, bool write) > { > struct zonefs_inode_info *zi = ZONEFS_I(inode); > struct super_block *sb = inode->i_sb; > - struct zonefs_sb_info *sbi = ZONEFS_SB(sb); > unsigned int noio_flag; > unsigned int nr_zones = > - zi->i_zone_size >> (sbi->s_zone_sectors_shift + SECTOR_SHIFT); > + bdev_zone_no(sb->s_bdev, zi->i_zone_size >> SECTOR_SHIFT); > struct zonefs_ioerr_data err = { > .inode = inode, > .write = write, > @@ -1300,7 +1299,7 @@ static void zonefs_init_file_inode(struct inode *inode, struct blk_zone *zone, > struct zonefs_sb_info *sbi = ZONEFS_SB(sb); > struct zonefs_inode_info *zi = ZONEFS_I(inode); > > - inode->i_ino = zone->start >> sbi->s_zone_sectors_shift; > + inode->i_ino = bdev_zone_no(sb->s_bdev, zone->start); > inode->i_mode = S_IFREG | sbi->s_perm; > > zi->i_ztype = type; > @@ -1647,7 +1646,6 @@ static int zonefs_fill_super(struct super_block *sb, void *data, int silent) > * interface constraints. > */ > sb_set_blocksize(sb, bdev_zone_write_granularity(sb->s_bdev)); > - sbi->s_zone_sectors_shift = ilog2(bdev_zone_sectors(sb->s_bdev)); > sbi->s_uid = GLOBAL_ROOT_UID; > sbi->s_gid = GLOBAL_ROOT_GID; > sbi->s_perm = 0640; > diff --git a/fs/zonefs/zonefs.h b/fs/zonefs/zonefs.h > index 7b147907c328..2d5ea3be3a8e 100644 > --- a/fs/zonefs/zonefs.h > +++ b/fs/zonefs/zonefs.h > @@ -175,7 +175,6 @@ struct zonefs_sb_info { > kgid_t s_gid; > umode_t s_perm; > uuid_t s_uuid; > - unsigned int s_zone_sectors_shift; > > unsigned int s_nr_files[ZONEFS_ZTYPE_MAX]; > -- Damien Le Moal Western Digital Research 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 Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2761FC433EF for ; Wed, 27 Apr 2022 23:39:49 +0000 (UTC) Received: from [127.0.0.1] (helo=sfs-ml-4.v29.lw.sourceforge.com) by sfs-ml-4.v29.lw.sourceforge.com with esmtp (Exim 4.94.2) (envelope-from ) id 1njrG7-0002WB-DY; Wed, 27 Apr 2022 23:39:46 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-4.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1njrG6-0002W5-8y for linux-f2fs-devel@lists.sourceforge.net; Wed, 27 Apr 2022 23:39:44 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Transfer-Encoding:Content-Type:In-Reply-To: From:References:Cc:To:Subject:MIME-Version:Date:Message-ID:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=1AB1XQxDQK3ZvB6f0g1bRoPnbSC4y/Y6L7PxXS2Kx3I=; b=bYcoM2/G1/LFNT5YIjQBMDpWwx wpnSs7xL1wGjQwmqn+vJ8Egj3BMoIzTGqHq0udNy8+AQ+uz4EsgulDuu14pPKh/ma3rTL2arfeNPq mbarWMU0/cVcfxK8Rzhyytr+k1ipwkFjUPw4FE/Ki6ohrauX1F++nqNN+c5XbmJs5PuY=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:References:Cc:To: Subject:MIME-Version:Date:Message-ID:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=1AB1XQxDQK3ZvB6f0g1bRoPnbSC4y/Y6L7PxXS2Kx3I=; b=T3dOrSyw2oSpvE2TfbHwU07o2U X0xb8DR3d4N6ygfr1UVNFMwFh4wUhvg69DM7FgIrK+YDzCgRLO6+t+tq1c2H+vTGOGaVk7NQxznOn mcyRmgK26EsbU6NWXPEcmheMo/zb0XibZ8bY8KZUDlqQXywZMnB20MckcWROK9F5V9t4=; Received: from esa2.hgst.iphmx.com ([68.232.143.124]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.94.2) id 1njrG1-0000EF-2h for linux-f2fs-devel@lists.sourceforge.net; Wed, 27 Apr 2022 23:39:44 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1651102780; x=1682638780; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=MKuYv4XGK8HdnYkTj9llLnq6WFfSVxaVrJlMmCv+wiQ=; b=JVR+1XVgJY/HIps56Ys89ckMb3SHSdCTQ5eqQhRMugnyuuYoezN7ra2G JKV91ikxLDWA2XLcCKLq7XPYE2Qu2mk8A2QaM7csAdHuQJNC7EHlB3tiJ 9KvmncedjmgqbqL7Xur85rpwW91uA4M8egLl+DD2foQgvdHS1RYs8xCl1 WDNH404DZCxEYcOC3Bzx7AmdBT4muOTQoCeVtgFZeidKM90Vhgvjt+FvB MmweKywd5BdhAMIiuPi8dMQPt6PlFLNBkM35zdpzvTi3ZF+CJ96MwYZsO WEOQop/yr0Q3DG3+KYKNKfA+dq8PH+jGZNnQxt4ex+Rxlq3WZ6Lum5JZ4 w==; X-IronPort-AV: E=Sophos;i="5.90,294,1643644800"; d="scan'208";a="303212735" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 28 Apr 2022 07:39:32 +0800 IronPort-SDR: l1TiWVJsEhO2ucTzTgL6NlC/oC/LNPxZTJb27G7Gq7KpyYLGY9OlxdCTPSbSy7RdrsakhvVswU BlFzKi91S7D5RaaDMUpRmUQlpeuO2AelbXA2z11aj03GdpWFjPx6sabU8oiMRYFgWG3rnyRzlu 8dk+6n/VVY+OV5wYxwMd0hbvIVt9mbYqBqIrcLlEmwF6kkmTvFeKImeM+X7P6WMApGHtWrLrod XhI3R8FQmk5qc3iRJ8V4xBNUMzB+KLIk7N4huPfhTWIRD9fJIEOtif1Gu0P+DL0rN6Pjx4884e XsRfeVdye2meAXgIgfQ9v5jH Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 27 Apr 2022 16:09:42 -0700 IronPort-SDR: ncSJDo2T+/ZA/8XbiSDr47amwgtj2QMRfC6m1UL4AA7QLQDBVZDj0cxNhFgKDfH2PSjGiF2eEv oUtqkbZ3ppLpmTwQ5noOsBMhjxhWK8w88fMJDJSWKsZG0E/y5sCYePiUvAvCzUAn8CbDoOCU+1 s+bclg6a+OhYCoo/sFs9ys3t54HLPCvQG88RO3D4S9jVGpmccK7ybAnU8CdnKkQ3btlmir2cGX 9dBeLaUwwrl2xvwnaPKH1LdS1WEtDo/EzPVMgkAjLmxjYv9+SjoigUQsHvLrF1hoG98twEOylj UG4= WDCIronportException: Internal Received: from usg-ed-osssrv.wdc.com ([10.3.10.180]) by uls-op-cesaip01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 27 Apr 2022 16:39:33 -0700 Received: from usg-ed-osssrv.wdc.com (usg-ed-osssrv.wdc.com [127.0.0.1]) by usg-ed-osssrv.wdc.com (Postfix) with ESMTP id 4KpZwN11brz1SVp7 for ; Wed, 27 Apr 2022 16:39:32 -0700 (PDT) Authentication-Results: usg-ed-osssrv.wdc.com (amavisd-new); dkim=pass reason="pass (just generated, assumed good)" header.d=opensource.wdc.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d= opensource.wdc.com; h=content-transfer-encoding:content-type :in-reply-to:organization:from:references:to:content-language :subject:user-agent:mime-version:date:message-id; s=dkim; t= 1651102770; x=1653694771; bh=MKuYv4XGK8HdnYkTj9llLnq6WFfSVxaVrJl MmCv+wiQ=; b=F5aK313D/33i58L2HhyWZlmIYLxYFRau6pifLJL1hYJrhXiCZ8a QUlDThdd2S3jmMYxAnQGrk3uOInkmqWWXkmRW3ymLN1LfKOS5+bY79RzMlQL1w3p byr+W7KlfQmvdAdTOFjqy4Bvd6pxExnVEQWWyxoWm8P74hjVHX/Vm9LlwbazeVIZ wJ7tVTr0brCKfrteamJp89kRredPxEKv83eWrlHtbe+v5l92MU36wBYsIEFDv/Kv dXViO7aRNsJw2ghY9ipJqj+m8Fo9xYv4zTR8q40gyecTBz59xhum1EvNku7fAoNM dMuWLLgJcGyyRSZREN2s2w7PK2MFxbc5f1g== X-Virus-Scanned: amavisd-new at usg-ed-osssrv.wdc.com Received: from usg-ed-osssrv.wdc.com ([127.0.0.1]) by usg-ed-osssrv.wdc.com (usg-ed-osssrv.wdc.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id oK4MF_FCCw7A for ; Wed, 27 Apr 2022 16:39:30 -0700 (PDT) Received: from [10.225.163.27] (unknown [10.225.163.27]) by usg-ed-osssrv.wdc.com (Postfix) with ESMTPSA id 4KpZwF5hMDz1Rvlc; Wed, 27 Apr 2022 16:39:25 -0700 (PDT) Message-ID: Date: Thu, 28 Apr 2022 08:39:24 +0900 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0 Content-Language: en-US To: Pankaj Raghav , jaegeuk@kernel.org, axboe@kernel.dk, snitzer@kernel.org, hch@lst.de, mcgrof@kernel.org, naohiro.aota@wdc.com, sagi@grimberg.me, dsterba@suse.com, johannes.thumshirn@wdc.com References: <20220427160255.300418-1-p.raghav@samsung.com> <20220427160255.300418-13-p.raghav@samsung.com> Organization: Western Digital Research In-Reply-To: <20220427160255.300418-13-p.raghav@samsung.com> X-Headers-End: 1njrG1-0000EF-2h Subject: Re: [f2fs-dev] [PATCH 12/16] zonefs: allow non power of 2 zoned devices X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Damien Le Moal via Linux-f2fs-devel Reply-To: Damien Le Moal Cc: jiangbo.365@bytedance.com, kch@nvidia.com, bvanassche@acm.org, matias.bjorling@wdc.com, gost.dev@samsung.com, linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org, linux-f2fs-devel@lists.sourceforge.net, linux-block@vger.kernel.org, clm@fb.com, dm-devel@redhat.com, agk@redhat.com, jonathan.derrick@linux.dev, kbusch@kernel.org, linux-fsdevel@vger.kernel.org, josef@toxicpanda.com, linux-btrfs@vger.kernel.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net On 4/28/22 01:02, Pankaj Raghav wrote: > The zone size shift variable is useful only if the zone sizes are known > to be power of 2. Remove that variable and use generic helpers from > block layer to calculate zone index in zonefs Period missing at the end of the sentence. What about zonefs-tools and its test suite ? Is everything still OK on that front ? I suspect not... > > Reviewed-by: Luis Chamberlain > Signed-off-by: Pankaj Raghav > --- > fs/zonefs/super.c | 6 ++---- > fs/zonefs/zonefs.h | 1 - > 2 files changed, 2 insertions(+), 5 deletions(-) > > diff --git a/fs/zonefs/super.c b/fs/zonefs/super.c > index 3614c7834007..5422be2ca570 100644 > --- a/fs/zonefs/super.c > +++ b/fs/zonefs/super.c > @@ -401,10 +401,9 @@ static void __zonefs_io_error(struct inode *inode, bool write) > { > struct zonefs_inode_info *zi = ZONEFS_I(inode); > struct super_block *sb = inode->i_sb; > - struct zonefs_sb_info *sbi = ZONEFS_SB(sb); > unsigned int noio_flag; > unsigned int nr_zones = > - zi->i_zone_size >> (sbi->s_zone_sectors_shift + SECTOR_SHIFT); > + bdev_zone_no(sb->s_bdev, zi->i_zone_size >> SECTOR_SHIFT); > struct zonefs_ioerr_data err = { > .inode = inode, > .write = write, > @@ -1300,7 +1299,7 @@ static void zonefs_init_file_inode(struct inode *inode, struct blk_zone *zone, > struct zonefs_sb_info *sbi = ZONEFS_SB(sb); > struct zonefs_inode_info *zi = ZONEFS_I(inode); > > - inode->i_ino = zone->start >> sbi->s_zone_sectors_shift; > + inode->i_ino = bdev_zone_no(sb->s_bdev, zone->start); > inode->i_mode = S_IFREG | sbi->s_perm; > > zi->i_ztype = type; > @@ -1647,7 +1646,6 @@ static int zonefs_fill_super(struct super_block *sb, void *data, int silent) > * interface constraints. > */ > sb_set_blocksize(sb, bdev_zone_write_granularity(sb->s_bdev)); > - sbi->s_zone_sectors_shift = ilog2(bdev_zone_sectors(sb->s_bdev)); > sbi->s_uid = GLOBAL_ROOT_UID; > sbi->s_gid = GLOBAL_ROOT_GID; > sbi->s_perm = 0640; > diff --git a/fs/zonefs/zonefs.h b/fs/zonefs/zonefs.h > index 7b147907c328..2d5ea3be3a8e 100644 > --- a/fs/zonefs/zonefs.h > +++ b/fs/zonefs/zonefs.h > @@ -175,7 +175,6 @@ struct zonefs_sb_info { > kgid_t s_gid; > umode_t s_perm; > uuid_t s_uuid; > - unsigned int s_zone_sectors_shift; > > unsigned int s_nr_files[ZONEFS_ZTYPE_MAX]; > -- Damien Le Moal Western Digital Research _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel 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 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BBFEBC4332F for ; Wed, 27 Apr 2022 23:39:41 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-549-HKfD1RWJO4qqnn5UJ7CLUg-1; Wed, 27 Apr 2022 19:39:37 -0400 X-MC-Unique: HKfD1RWJO4qqnn5UJ7CLUg-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E055D29AA2ED; Wed, 27 Apr 2022 23:39:35 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id CED8B40D1B99; Wed, 27 Apr 2022 23:39:35 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 9C27B1947046; Wed, 27 Apr 2022 23:39:35 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 942B51947041 for ; Wed, 27 Apr 2022 23:39:34 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 83E2C550868; Wed, 27 Apr 2022 23:39:34 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast04.extmail.prod.ext.rdu2.redhat.com [10.11.55.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7F7B655085D for ; Wed, 27 Apr 2022 23:39:34 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 65FA7101AA44 for ; Wed, 27 Apr 2022 23:39:34 +0000 (UTC) Received: from esa2.hgst.iphmx.com (esa2.hgst.iphmx.com [68.232.143.124]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-215-NThz70-jM3mckkVeq4YGFA-2; Wed, 27 Apr 2022 19:39:33 -0400 X-MC-Unique: NThz70-jM3mckkVeq4YGFA-2 X-IronPort-AV: E=Sophos;i="5.90,294,1643644800"; d="scan'208";a="303212730" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 28 Apr 2022 07:39:31 +0800 IronPort-SDR: IRaQVY9WtESSdGsjZmSm9L4qXGECa93jTWcDWJNaFCbDrbRGvkrz0m8N7QKKz7dG9MkzGlGLmI wqf5H16ymmAH65bmk8ohHf42uDtur1u4De8emkryNlaFowc1+hVNkkrTrMEPEB0RraGXyMbZwR DGAQXOUs5Uf8S8ce/OJ+CgDRg1WJcx4IVEYMpni2Y1SRtHlTIwSUfbs8Z6RKtEQ0ZoJI7ehpgl euhZ6OGPXwT+pe/zpcITlUXUJflY2el7ygG04Lun2luI316+tcV/ZkbVv8AT01iFH8Il58WNV1 ZA7st5WGgr500kh2CCPl18u4 Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 27 Apr 2022 16:10:23 -0700 IronPort-SDR: DlErNgstoCFffa2icIl4768jAX5mn+rrUOzjgfmcMvlVQV0wphmMXIAkAD5SNPrs7sZHagTeyN sUqAtZVindPQ9VpVOGEd8pmRkuyv1dyY1QA5s5wiydBwxlD5lzf9v7OM6vKdUcacczWAcWQLq2 8NQinoie/R7fupM4HCpxLsgL67PWikfWfDhXFnmPP9vtHwKZT/jML1Dwy+cHPIIUw0rlj0aCuW VW58nJLJVmblPGfHkivM5N/txYCDepdM9nxCK4n/koHcnoZGqmFUo4eyOYkDjw1yiABRpHaWcZ I5M= WDCIronportException: Internal Received: from usg-ed-osssrv.wdc.com ([10.3.10.180]) by uls-op-cesaip01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 27 Apr 2022 16:39:32 -0700 Received: from usg-ed-osssrv.wdc.com (usg-ed-osssrv.wdc.com [127.0.0.1]) by usg-ed-osssrv.wdc.com (Postfix) with ESMTP id 4KpZwL5l5zz1SVp1 for ; Wed, 27 Apr 2022 16:39:30 -0700 (PDT) X-Virus-Scanned: amavisd-new at usg-ed-osssrv.wdc.com Received: from usg-ed-osssrv.wdc.com ([127.0.0.1]) by usg-ed-osssrv.wdc.com (usg-ed-osssrv.wdc.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id Jm_xtF5SvtJC for ; Wed, 27 Apr 2022 16:39:29 -0700 (PDT) Received: from [10.225.163.27] (unknown [10.225.163.27]) by usg-ed-osssrv.wdc.com (Postfix) with ESMTPSA id 4KpZwF5hMDz1Rvlc; Wed, 27 Apr 2022 16:39:25 -0700 (PDT) Message-ID: Date: Thu, 28 Apr 2022 08:39:24 +0900 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0 To: Pankaj Raghav , jaegeuk@kernel.org, axboe@kernel.dk, snitzer@kernel.org, hch@lst.de, mcgrof@kernel.org, naohiro.aota@wdc.com, sagi@grimberg.me, dsterba@suse.com, johannes.thumshirn@wdc.com References: <20220427160255.300418-1-p.raghav@samsung.com> <20220427160255.300418-13-p.raghav@samsung.com> From: Damien Le Moal Organization: Western Digital Research In-Reply-To: <20220427160255.300418-13-p.raghav@samsung.com> X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.85 on 10.11.54.9 Subject: Re: [dm-devel] [PATCH 12/16] zonefs: allow non power of 2 zoned devices X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: jiangbo.365@bytedance.com, kch@nvidia.com, bvanassche@acm.org, matias.bjorling@wdc.com, gost.dev@samsung.com, chao@kernel.org, linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org, linux-f2fs-devel@lists.sourceforge.net, linux-block@vger.kernel.org, clm@fb.com, dm-devel@redhat.com, agk@redhat.com, jonathan.derrick@linux.dev, kbusch@kernel.org, linux-fsdevel@vger.kernel.org, josef@toxicpanda.com, linux-btrfs@vger.kernel.org Errors-To: dm-devel-bounces@redhat.com Sender: "dm-devel" X-Scanned-By: MIMEDefang 2.84 on 10.11.54.2 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dm-devel-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit On 4/28/22 01:02, Pankaj Raghav wrote: > The zone size shift variable is useful only if the zone sizes are known > to be power of 2. Remove that variable and use generic helpers from > block layer to calculate zone index in zonefs Period missing at the end of the sentence. What about zonefs-tools and its test suite ? Is everything still OK on that front ? I suspect not... > > Reviewed-by: Luis Chamberlain > Signed-off-by: Pankaj Raghav > --- > fs/zonefs/super.c | 6 ++---- > fs/zonefs/zonefs.h | 1 - > 2 files changed, 2 insertions(+), 5 deletions(-) > > diff --git a/fs/zonefs/super.c b/fs/zonefs/super.c > index 3614c7834007..5422be2ca570 100644 > --- a/fs/zonefs/super.c > +++ b/fs/zonefs/super.c > @@ -401,10 +401,9 @@ static void __zonefs_io_error(struct inode *inode, bool write) > { > struct zonefs_inode_info *zi = ZONEFS_I(inode); > struct super_block *sb = inode->i_sb; > - struct zonefs_sb_info *sbi = ZONEFS_SB(sb); > unsigned int noio_flag; > unsigned int nr_zones = > - zi->i_zone_size >> (sbi->s_zone_sectors_shift + SECTOR_SHIFT); > + bdev_zone_no(sb->s_bdev, zi->i_zone_size >> SECTOR_SHIFT); > struct zonefs_ioerr_data err = { > .inode = inode, > .write = write, > @@ -1300,7 +1299,7 @@ static void zonefs_init_file_inode(struct inode *inode, struct blk_zone *zone, > struct zonefs_sb_info *sbi = ZONEFS_SB(sb); > struct zonefs_inode_info *zi = ZONEFS_I(inode); > > - inode->i_ino = zone->start >> sbi->s_zone_sectors_shift; > + inode->i_ino = bdev_zone_no(sb->s_bdev, zone->start); > inode->i_mode = S_IFREG | sbi->s_perm; > > zi->i_ztype = type; > @@ -1647,7 +1646,6 @@ static int zonefs_fill_super(struct super_block *sb, void *data, int silent) > * interface constraints. > */ > sb_set_blocksize(sb, bdev_zone_write_granularity(sb->s_bdev)); > - sbi->s_zone_sectors_shift = ilog2(bdev_zone_sectors(sb->s_bdev)); > sbi->s_uid = GLOBAL_ROOT_UID; > sbi->s_gid = GLOBAL_ROOT_GID; > sbi->s_perm = 0640; > diff --git a/fs/zonefs/zonefs.h b/fs/zonefs/zonefs.h > index 7b147907c328..2d5ea3be3a8e 100644 > --- a/fs/zonefs/zonefs.h > +++ b/fs/zonefs/zonefs.h > @@ -175,7 +175,6 @@ struct zonefs_sb_info { > kgid_t s_gid; > umode_t s_perm; > uuid_t s_uuid; > - unsigned int s_zone_sectors_shift; > > unsigned int s_nr_files[ZONEFS_ZTYPE_MAX]; > -- Damien Le Moal Western Digital Research -- dm-devel mailing list dm-devel@redhat.com https://listman.redhat.com/mailman/listinfo/dm-devel