Received: by 2002:ac0:e350:0:0:0:0:0 with SMTP id g16csp452868imn; Wed, 3 Aug 2022 10:50:00 -0700 (PDT) X-Google-Smtp-Source: AA6agR6U49u5dJYMXjKN/A5QNDtSbpWw9MiPDmp/+Z4y2wpcnEGg+Njy74Yp6c40fxHByjbaa/5m X-Received: by 2002:a17:90a:c402:b0:1f2:ca71:93a5 with SMTP id i2-20020a17090ac40200b001f2ca7193a5mr6058535pjt.34.1659549000211; Wed, 03 Aug 2022 10:50:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659549000; cv=none; d=google.com; s=arc-20160816; b=uAUUVUCuWQLl2jHKf9U8QnWkIxI1a65n4ufCIye/MSlOP8qp1/ZCByCvEx49zJma19 PkG7tx8WQZ9ThBjDiQMGedQ1dC5S8i6drS4scGFjRioadKx/9Ca9vWBsnsgN5dUhxSzv giVa1c+99dDlUnGeYlKalqNGDccB714dPpMmlgYI6S7Wg0y4GyOltL8SwJxUDwrhmt+4 3Y/1s8jxAQDQE84Pe6+WZy6LUtoL4Xc/ImEmo7IuvKI8lk1Pic639a6NeqgjZMXJXkIb 1Z6H1lecSZn5Xgjt8M+cDSgi2k1VDCvBMgyzl+vawMbQVOQODMFmlKUSC63xmpZNdL51 5Kcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=81PY4yBEEjUXxYOBG5CambynNE+HXFQDS99frEnDmrs=; b=D/2oDWtkStGNH9t3P5bQj1tqi8qS5Al+XSSfUAM9pnECzPkAS6BdE43QaYoX1HtKIY FUTfJg6+bAxUGEXITL04BbGbgPmNaTTmNIpjtNCij4jt4VNhvxGxc+mEhBXh9l3vQJif ObpcI1ZoXWHMOLNWK5CSGJzY9A54Jwdh5mEqTYqhiDI3slzXk8hhFY5OEkOnw75xxSix sCwVzjN77tFprglmuwjFZ477Oiuecopm3tj0bHBy4Qo7u7z3bCI1dl8Zh4KbuzR83DKG R999iYPg5D20G4A4SwK9QhhmtyB8oXKvLDMPdOud6xfqv/xtapXBNynixL3q3vR2RDxx O8QA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=acm.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u6-20020a056a00158600b0051bbbc5f0aasi17974980pfk.261.2022.08.03.10.49.41; Wed, 03 Aug 2022 10:50:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=acm.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237672AbiHCRWq (ORCPT + 99 others); Wed, 3 Aug 2022 13:22:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60298 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237954AbiHCRWh (ORCPT ); Wed, 3 Aug 2022 13:22:37 -0400 Received: from mail-pj1-f52.google.com (mail-pj1-f52.google.com [209.85.216.52]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8EB7331221; Wed, 3 Aug 2022 10:22:36 -0700 (PDT) Received: by mail-pj1-f52.google.com with SMTP id gj1so2206379pjb.0; Wed, 03 Aug 2022 10:22:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc; bh=81PY4yBEEjUXxYOBG5CambynNE+HXFQDS99frEnDmrs=; b=CGfKva3CMvsWDePIc6xTlmFoJOD1YLJYwOtdI5TyUjSKFAYSN8kmF0QSPSR6fFxex7 rKl51NaF91TEmC1clmqqADcVNdeu2TRqokPCx24imeLcxNZVBPB33dryBi4IXCCRMM80 fslp7/abwy+LN13RvpWKKNF0Kz9/E4rIwVqD/zVCI4wxG1GomZbwWdCEdLs6ptejoBCI KjU0fIlNu0q5giNnxQWc5Thv+i0so/vD5LUxTDBJ68yDJa6lzGtGDpbyTsp8v67/ZXC4 A9RYdAavbHA7w8Cwm6BhPDUANCnlBf4fG7o6yPj8p8EXINTDWvm1fBASMKuoHJGI1YVB zKoA== X-Gm-Message-State: ACgBeo0ch/Lq7agu5NafHSkwomVve8aDV4nna1Z2oEycpbu7FREyWdyS k5OReraPweMYBOcs9Uh3Gq4= X-Received: by 2002:a17:902:f54e:b0:16f:206b:74cc with SMTP id h14-20020a170902f54e00b0016f206b74ccmr1132384plf.170.1659547355934; Wed, 03 Aug 2022 10:22:35 -0700 (PDT) Received: from ?IPV6:2620:15c:211:201:db71:edb7:462a:44af? ([2620:15c:211:201:db71:edb7:462a:44af]) by smtp.gmail.com with ESMTPSA id l7-20020a170903244700b0016cd74dae66sm2275344pls.28.2022.08.03.10.22.33 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 03 Aug 2022 10:22:35 -0700 (PDT) Message-ID: <2616b59b-8c6b-a482-a396-d9408fa461a3@acm.org> Date: Wed, 3 Aug 2022 10:22:32 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [dm-devel] [PATCH v9 05/13] nvme: zns: Allow ZNS drives that have non-power_of_2 zone size Content-Language: en-US To: Pankaj Raghav , Johannes.Thumshirn@wdc.com, snitzer@kernel.org, axboe@kernel.dk, damien.lemoal@opensource.wdc.com, agk@redhat.com, hch@lst.de Cc: pankydev8@gmail.com, gost.dev@samsung.com, linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org, linux-block@vger.kernel.org, dm-devel@redhat.com, jaegeuk@kernel.org, matias.bjorling@wdc.com, Luis Chamberlain References: <20220803094801.177490-1-p.raghav@samsung.com> <20220803094801.177490-6-p.raghav@samsung.com> From: Bart Van Assche In-Reply-To: <20220803094801.177490-6-p.raghav@samsung.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/3/22 02:47, Pankaj Raghav wrote: > - sector &= ~(ns->zsze - 1); > + /* > + * Round down the sector value to the nearest zone start > + */ > + div64_u64_rem(sector, ns->zsze, &remainder); > + sector -= remainder; Could bdev_offset_from_zone_start() be used here? Thanks, Bart.