Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3473832rwb; Tue, 16 Aug 2022 03:50:40 -0700 (PDT) X-Google-Smtp-Source: AA6agR6han1Zdu2yblLteqWyHVqrmQiP6HwVjdXwA90x8tdBi0eXGprMIHkEQ0b1HEGiQW6dObL8 X-Received: by 2002:a05:6a00:1252:b0:52f:755c:a384 with SMTP id u18-20020a056a00125200b0052f755ca384mr20657904pfi.2.1660647040094; Tue, 16 Aug 2022 03:50:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660647040; cv=none; d=google.com; s=arc-20160816; b=hdm/+YsULo+IID1qaeNi/axJeqdc77rcWOnwz+cKmT62NMfaVo+Fg5FXVDF5Jenuuj xtFjo45ZprvTi0Uz8zkzjzpdclscCb86fVJUCu4WioszNcEXl0hHdjehkzGEJsL5+XhB NgsJbYvaHItdn7L6BqM6uU343YfesOFBzFjmNoFEpEqaizF8HMg9n3gSbIBceCyj+neC SuXfucG+q6kWRawwSLOCM8C3ikrUEXAf8hl45V5zBTfpl28vVmHL53dQaEfPJRVz29hC RJ3VMrTL0MXNST6mW0ixArhs7hRnJkFeK53QQYHaPAlmnX020JRw56TEiTrVORQO6ZKZ M1Xg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:cms-type:content-transfer-encoding :in-reply-to:from:cc:to:content-language:subject:user-agent :mime-version:date:message-id:dkim-signature:dkim-filter; bh=w+UeNKFPkWuzxd2gXXq4NTrE0Bz4wmcfIlzmDBOFbwQ=; b=T+afS96EBXr60tAEgY/yHEnGoMU3kM74muKnFz7UnYIIJnOXMRM7sVtTMXcpCiF0Ni R9QgtYIGoY6rHE9ZbDgBgpBBfqvSqwu9N+DfsBQw5xXH/9mTULSuTnVgFve7lIRBY+Ea r9SNwpDOHpm1ulcA1sHj0slL8LXR6F29LbzOXF+Y5dHGtJJzjv92VVDLBA+TrTrYcNUU KjL/5+tvh8apGx4kiqZsXqE++bd0sck5cxDQYHPWO7oOQDYnIQOtW8biM6GAcplyboXT 0P2nuJ9PrL+TcCYFMe6FmyXwPgsL7eNGSDQZNlR063wcJ/eMyXmE9q6K+qFKdhkZJelt 5qSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=RAR1wRHu; 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=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k22-20020a170902761600b0016dc3b5367asi12230571pll.608.2022.08.16.03.50.24; Tue, 16 Aug 2022 03:50:40 -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; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=RAR1wRHu; 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=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234240AbiHPKCm (ORCPT + 99 others); Tue, 16 Aug 2022 06:02:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43992 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232084AbiHPKCG (ORCPT ); Tue, 16 Aug 2022 06:02:06 -0400 Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2DF1FC877A for ; Tue, 16 Aug 2022 01:02:41 -0700 (PDT) Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20220816080235euoutp0144f491b0d112eddf954beab6ab8e5d5b~LxIMq31ck0597405974euoutp01e for ; Tue, 16 Aug 2022 08:02:35 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20220816080235euoutp0144f491b0d112eddf954beab6ab8e5d5b~LxIMq31ck0597405974euoutp01e DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1660636955; bh=w+UeNKFPkWuzxd2gXXq4NTrE0Bz4wmcfIlzmDBOFbwQ=; h=Date:Subject:To:CC:From:In-Reply-To:References:From; b=RAR1wRHu/BOFrAZmorCEpSM25V699cyBQtLPd69h0FXvshEQxlSaKx/gjdVWQ20Cp +FQPly9vQ/mSkIcOax1fsW3h7PmR3/oPsL7/pbrf0qte37ScWjYTmwxnWdDAFtt+oF 4yrusIBitn8qORdscYpwxOjswQhyn8Onn0Fp09Y8= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20220816080234eucas1p1944800b3870bef434c619543e727f2d8~LxIMQJt2H0475004750eucas1p1F; Tue, 16 Aug 2022 08:02:34 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id DE.46.09580.A1F4BF26; Tue, 16 Aug 2022 09:02:34 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20220816080234eucas1p2ec04f60bad4888c708d7c57f5aab5d47~LxIL0Fflp2135521355eucas1p2u; Tue, 16 Aug 2022 08:02:34 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20220816080234eusmtrp2222f44d8dffbb9c0cbd291bd2fceb90b~LxILy-Wxp1663716637eusmtrp2D; Tue, 16 Aug 2022 08:02:34 +0000 (GMT) X-AuditID: cbfec7f5-9c3ff7000000256c-80-62fb4f1a8245 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id D8.4F.09095.A1F4BF26; Tue, 16 Aug 2022 09:02:34 +0100 (BST) Received: from CAMSVWEXC01.scsc.local (unknown [106.1.227.71]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20220816080234eusmtip2b83e83d28d6f473c7506bda77a4da005~LxILlzw4B1996419964eusmtip2c; Tue, 16 Aug 2022 08:02:34 +0000 (GMT) Received: from [192.168.8.130] (106.210.248.18) by CAMSVWEXC01.scsc.local (2002:6a01:e347::6a01:e347) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 16 Aug 2022 09:02:31 +0100 Message-ID: Date: Tue, 16 Aug 2022 10:02:29 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH v10 13/13] dm: add power-of-2 target for zoned devices with non power-of-2 zone sizes Content-Language: en-US To: Damien Le Moal , , , , CC: , , , , , , , , , , , Damien Le Moal , Joel Granados From: Pankaj Raghav In-Reply-To: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [106.210.248.18] X-ClientProxiedBy: CAMSVWEXC01.scsc.local (2002:6a01:e347::6a01:e347) To CAMSVWEXC01.scsc.local (2002:6a01:e347::6a01:e347) X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrKKsWRmVeSWpSXmKPExsWy7djP87pS/r+TDJ4s0rVYf+oYs8Xqu/1s FtM+/GS2+H32PLNFa/s3Jou972azWuxZNInJYuXqo0wWT9bPYrb423UPKHFL2+LyrjlsFvOX PWW3mND2ldlizc2nLBYnbkk7CHhcvuLtsXPWXXaPy2dLPTat6mTz2Lyk3mP3zQY2j52t91k9 3u+7ChQ6Xe3xeZOcR/uBbqYA7igum5TUnMyy1CJ9u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60bad4888c708d7c57f5aab5d47 X-Msg-Generator: CA X-RootMTR: 20220811143058eucas1p247291685ffff7a75186947fd30b5c13f X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20220811143058eucas1p247291685ffff7a75186947fd30b5c13f References: <20220811143043.126029-1-p.raghav@samsung.com> <20220811143043.126029-14-p.raghav@samsung.com> X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_HI,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 > > I think this is way better. But I would still reorganize this like this: > > static int dm_po2z_map(struct dm_target *ti, struct bio *bio) > { > struct dm_po2z_target *dmh = ti->private; > int split_io_pos; > > bio_set_dev(bio, dmh->dev->bdev); > > if (op_is_zone_mgmt(bio_op(bio))) > return dm_po2z_remap_sector(dmh, bio); > > if (!bio_sectors(bio)) > return DM_MAPIO_REMAPPED; > > /* > * Read operation on the emulated zone area (between zone capacity > * and zone size) will fill the bio with zeroes. Any other operation > * in the emulated area should return an error. > */ > if (!bio_in_emulated_zone_area(dmh, bio, &split_io_pos)) > return dm_po2z_remap_sector(dmh, bio); > > if (bio_op(bio) == REQ_OP_READ) { > if (split_io_pos > 0) { > dm_accept_partial_bio(bio, split_io_pos); > return dm_po2z_remap_sector(dmh, bio); > } > return dm_po2z_read_zeroes(bio); > } > > return DM_MAPIO_KILL; > } > > I find the code easier to follow this way. > I agree. It is definitely easier to follow. I will make these changes and send the next version soon. > >