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 1C6E1C433EF for ; Tue, 5 Jul 2022 02:32:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231579AbiGECcE (ORCPT ); Mon, 4 Jul 2022 22:32:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54236 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234459AbiGECcD (ORCPT ); Mon, 4 Jul 2022 22:32:03 -0400 Received: from esa4.hgst.iphmx.com (esa4.hgst.iphmx.com [216.71.154.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A4E1024E for ; Mon, 4 Jul 2022 19:32:02 -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=1656988322; x=1688524322; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=Ro+fI82nD1IGiNFuAK6LUHDwCz2uvuI1Aih9ZqsmmTw=; b=DidzLw8TIyZXMUerkWrmdl3+S313+LBoyri8MYv1NzQQiLiAU61zbD2O 2GY/fEgNvVk/jNdB2YbF6A1edzZqKLFdjUjtUrYoZDilZnEw0tE1eBaEt K7RQLm7dJ5b3SFdiybVmQFIWvUREY8rISgSTjCnrpKWI+5Cfz8tdFet6u ikHODzhyOraJ/bVAlrPihbjiR4UBvYNob4REJrm6eWeaPuuz9DRXSr/PK acM6iRE+W6ByMJ7CkYcu1uI9qjeVmk6MCwrvhLPFIYCEpjeHkDNKWd2mH RsxFkmta75k2PfEdhBWzyaHfFuG40MiVjxs4HmKpryJD9hb4klOH3mFAV A==; X-IronPort-AV: E=Sophos;i="5.92,245,1650902400"; d="scan'208";a="203465757" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 05 Jul 2022 10:32:01 +0800 IronPort-SDR: Ys/O162habi1N/pDHK8JI0pn6Vi3+G8mlsmwoGCZlvLUijzVvd3G+rmcSKO1ZYF8Xe1u0X6A1F /7ks5cjXrLUreNpHx5LFu3OuaRFwJ+dg7zFOolfognY66VYGXVd3muDoeRWFw8D+DPRYsEwLrE UdHbwksdJ3F0AcF697bppnm8M5vDrD4G5bKoD3ew/Dj0tIDJ36qx2iq92PDYBGSOF2H3ak48O9 Mg6z/q/qbMUbEzGjDemfkX0DLRrfecceZuI0LIuBzmS1UlSJUB9TMTr18DVtIvJZ4vJZSvw9X5 nRbAVjTA1Sq7AYyoW7wGQb5P 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; 04 Jul 2022 18:49:20 -0700 IronPort-SDR: dBYNfrxwLNQhZh4sVZEOyJnJezGusx0/aw5X/8VyIz8kxopXdrYAbs80hfj4LARDQhqQSWwYKG UKCU9ZJSyfoZXuwpD7KeXcMqsCt5u+g2bi8F213Eub5JyPoKejlR4IzxVsIFEpZSdtL9KQ9B0i ikMJJlD6N5b11turs005GMvG4H4o/IJMejlwOee6SlLod6uCO+Y2XTVfdn6HHHAuyH4E1WWz7b BGAiBP5kwWzUshuZVNXZSuA5+oaprNRjbh0jTbg7RQgtl5TQ6K4XQFR9IEbKuatDcMK5nMwsFl 8i4= 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; 04 Jul 2022 19:32:01 -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 4LcRX052Kmz1Rwnm for ; Mon, 4 Jul 2022 19:32:00 -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= 1656988320; x=1659580321; bh=Ro+fI82nD1IGiNFuAK6LUHDwCz2uvuI1Aih 9ZqsmmTw=; b=E5si8k2AyrL9p+0u2wPVEH9uM3pJyLDKNMYvqS466EiGZ7b8VQB Gb7Iy6h91Um4fbaue0VXVzRShIykbnYeMZvnb0bxB8zYCtpzUrAjwtYgn7KT4mmq w2zTI8JvTz+HT4F0gPIrfPyrHTbIGKHiVf5t31RyJvGffCAOhmbdeeyf1o0kTdLj lJ4Fh/bBLjt4LSpdng5pQRsC8rebZ3TnSbPRmIizfLfBp3vLt503L0IQAg7BryG3 tCYgfcbvIbno2pSFTz0V4SYjsIt5ctML2m4WttC3NQ5aT85/DsjznkS0LsLpru2v 7MWgNzCTA7jMlsE8ue0OR8OyDB8cIgKXfqw== 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 9a_feJW0DjVQ for ; Mon, 4 Jul 2022 19:32:00 -0700 (PDT) Received: from [10.225.163.105] (unknown [10.225.163.105]) by usg-ed-osssrv.wdc.com (Postfix) with ESMTPSA id 4LcRWz1GBQz1RtVk; Mon, 4 Jul 2022 19:31:58 -0700 (PDT) Message-ID: <9e815a0b-0d60-730a-51f8-6ba749b5c60e@opensource.wdc.com> Date: Tue, 5 Jul 2022 11:31:57 +0900 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 05/17] block: export blkdev_zone_mgmt_all Content-Language: en-US To: Christoph Hellwig , Jens Axboe Cc: dm-devel@redhat.com, linux-block@vger.kernel.org, linux-nvme@lists.infradead.org, linux-scsi@vger.kernel.org References: <20220704124500.155247-1-hch@lst.de> <20220704124500.155247-6-hch@lst.de> From: Damien Le Moal Organization: Western Digital Research In-Reply-To: <20220704124500.155247-6-hch@lst.de> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org On 7/4/22 21:44, Christoph Hellwig wrote: > Export blkdev_zone_mgmt_all so that the nvme target can use it instead > of duplicating the functionality. > > Signed-off-by: Christoph Hellwig Reviewed-by: Damien Le Moal > --- > block/blk-zoned.c | 10 +++++----- > include/linux/blkdev.h | 2 ++ > 2 files changed, 7 insertions(+), 5 deletions(-) > > diff --git a/block/blk-zoned.c b/block/blk-zoned.c > index 90a5c9cc80ab3..7fbe395fa51fc 100644 > --- a/block/blk-zoned.c > +++ b/block/blk-zoned.c > @@ -185,8 +185,8 @@ static int blk_zone_need_reset_cb(struct blk_zone *zone, unsigned int idx, > } > } > > -static int blkdev_zone_reset_all_emulated(struct block_device *bdev, > - gfp_t gfp_mask) > +int blkdev_zone_mgmt_all(struct block_device *bdev, unsigned int op, > + gfp_t gfp_mask) > { > struct request_queue *q = bdev_get_queue(bdev); > sector_t capacity = get_capacity(bdev->bd_disk); > @@ -213,8 +213,7 @@ static int blkdev_zone_reset_all_emulated(struct block_device *bdev, > continue; > } > > - bio = blk_next_bio(bio, bdev, 0, REQ_OP_ZONE_RESET | REQ_SYNC, > - gfp_mask); > + bio = blk_next_bio(bio, bdev, 0, op | REQ_SYNC, gfp_mask); > bio->bi_iter.bi_sector = sector; > sector += zone_sectors; > > @@ -231,6 +230,7 @@ static int blkdev_zone_reset_all_emulated(struct block_device *bdev, > kfree(need_reset); > return ret; > } > +EXPORT_SYMBOL_GPL(blkdev_zone_mgmt_all); > > static int blkdev_zone_reset_all(struct block_device *bdev, gfp_t gfp_mask) > { > @@ -295,7 +295,7 @@ int blkdev_zone_mgmt(struct block_device *bdev, enum req_opf op, > */ > if (op == REQ_OP_ZONE_RESET && sector == 0 && nr_sectors == capacity) { > if (!blk_queue_zone_resetall(q)) > - return blkdev_zone_reset_all_emulated(bdev, gfp_mask); > + return blkdev_zone_mgmt_all(bdev, op, gfp_mask); > return blkdev_zone_reset_all(bdev, gfp_mask); > } > > diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h > index 270cd0c552924..b9baee910b825 100644 > --- a/include/linux/blkdev.h > +++ b/include/linux/blkdev.h > @@ -302,6 +302,8 @@ unsigned int blkdev_nr_zones(struct gendisk *disk); > extern int blkdev_zone_mgmt(struct block_device *bdev, enum req_opf op, > sector_t sectors, sector_t nr_sectors, > gfp_t gfp_mask); > +int blkdev_zone_mgmt_all(struct block_device *bdev, unsigned int op, > + gfp_t gfp_mask); > int blk_revalidate_disk_zones(struct gendisk *disk, > void (*update_driver_data)(struct gendisk *disk)); > -- 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 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 56D85C43334 for ; Tue, 5 Jul 2022 02:32:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1656988342; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=dnApMSqqjZ7lCFh+vFI7ARMM7qTioAi8zQxUo1tiB54=; b=CXTvErKy6KGzfVYEU1W1tXlR+LsmsV1RwQytasZIRHZk48Sz744+3gE3JzcX9i5ay2Y+5U 46PRrWz43tp36ijfc0q9+01vE2QtrnClLLVf+3PF+cdFoCVecR/7O4naJxrKb4YNeVtUVG Ukik4B43Hi42RBQwBQTTEy1R+biRi5U= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-557-8sXux6L7PvucF2mJk6Xs0Q-1; Mon, 04 Jul 2022 22:32:18 -0400 X-MC-Unique: 8sXux6L7PvucF2mJk6Xs0Q-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 0086389C7DC; Tue, 5 Jul 2022 02:32:17 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id A8C84C27E83; Tue, 5 Jul 2022 02:32:16 +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 7CBAE194704A; Tue, 5 Jul 2022 02:32:16 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 0368B1947041 for ; Tue, 5 Jul 2022 02:32:14 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id E28A140D1B97; Tue, 5 Jul 2022 02:32:14 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast10.extmail.prod.ext.rdu2.redhat.com [10.11.55.26]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DE7AC40C1241 for ; Tue, 5 Jul 2022 02:32:14 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) (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 C51F21C068C7 for ; Tue, 5 Jul 2022 02:32:14 +0000 (UTC) Received: from esa4.hgst.iphmx.com (esa4.hgst.iphmx.com [216.71.154.42]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-670-lwFDbqbrPKCGqnvyieQFsQ-1; Mon, 04 Jul 2022 22:32:05 -0400 X-MC-Unique: lwFDbqbrPKCGqnvyieQFsQ-1 X-IronPort-AV: E=Sophos;i="5.92,245,1650902400"; d="scan'208";a="203465769" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 05 Jul 2022 10:32:04 +0800 IronPort-SDR: 1Mn6EJbnaFDU3zym8HGRBMA7D70QChTmPR8EepqzoAwZ40O8gRpOo6rYYatxbBlSRkHBKlknK2 eTbMezg+7KzULME6Z9ZIVnds7/VyiTExU7EWyGZZTmlD5SkjL9OpyO6/Aqvi0dn+e/nuazRxT2 TjF+oV9A6SLZDI7k2wMEVLi1Jjnbv1COlP13+ms/X5VlMDXW5Fq2XEIqAKx9bmUtcg2gOjiMYa B6hmSAnrsZYRX1449+fcxWEGsB4DIHwtir9Tk2q06V5P1/9UWk1D6050WkFTZrDgxffMgGbsxL yXs/fZjHEDeMTjfRuMvy7oOV 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; 04 Jul 2022 18:49:23 -0700 IronPort-SDR: j1RXgcKS55vW3QpZ5c8G01sclD1NluFki6BbMzmXK1WjqWlsrjbc5jwVLKatpboZpcJkATn8hO 5+Off1KcSropMeb2BXHH+KcoCNvJNxAcShmKediSt5CU1K5DEXNigqTp9dUP5rpXxmh+3SmmC0 4uk4hKRaZO0NVp/pPWhL7z5UXMdJLuLcBlqql0QX2ksqgDGL1Nrg64EKrZQpPfvqznnXLsamY1 Ne6XGi8D78ghxDXTJU+IyT7kcSoaK5jSoMMZBLKCBWVmCUEjJWF5TcmqLiI/k8cuZpCE2uiTZF sV8= 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; 04 Jul 2022 19:32:01 -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 4LcRX05NkBz1RwqM for ; Mon, 4 Jul 2022 19:32:00 -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 nkxXbxlh_G6L for ; Mon, 4 Jul 2022 19:32:00 -0700 (PDT) Received: from [10.225.163.105] (unknown [10.225.163.105]) by usg-ed-osssrv.wdc.com (Postfix) with ESMTPSA id 4LcRWz1GBQz1RtVk; Mon, 4 Jul 2022 19:31:58 -0700 (PDT) Message-ID: <9e815a0b-0d60-730a-51f8-6ba749b5c60e@opensource.wdc.com> Date: Tue, 5 Jul 2022 11:31:57 +0900 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 To: Christoph Hellwig , Jens Axboe References: <20220704124500.155247-1-hch@lst.de> <20220704124500.155247-6-hch@lst.de> From: Damien Le Moal Organization: Western Digital Research In-Reply-To: <20220704124500.155247-6-hch@lst.de> 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.84 on 10.11.54.2 Subject: Re: [dm-devel] [PATCH 05/17] block: export blkdev_zone_mgmt_all 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: linux-block@vger.kernel.org, dm-devel@redhat.com, linux-scsi@vger.kernel.org, linux-nvme@lists.infradead.org Errors-To: dm-devel-bounces@redhat.com Sender: "dm-devel" X-Scanned-By: MIMEDefang 2.85 on 10.11.54.8 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 7/4/22 21:44, Christoph Hellwig wrote: > Export blkdev_zone_mgmt_all so that the nvme target can use it instead > of duplicating the functionality. > > Signed-off-by: Christoph Hellwig Reviewed-by: Damien Le Moal > --- > block/blk-zoned.c | 10 +++++----- > include/linux/blkdev.h | 2 ++ > 2 files changed, 7 insertions(+), 5 deletions(-) > > diff --git a/block/blk-zoned.c b/block/blk-zoned.c > index 90a5c9cc80ab3..7fbe395fa51fc 100644 > --- a/block/blk-zoned.c > +++ b/block/blk-zoned.c > @@ -185,8 +185,8 @@ static int blk_zone_need_reset_cb(struct blk_zone *zone, unsigned int idx, > } > } > > -static int blkdev_zone_reset_all_emulated(struct block_device *bdev, > - gfp_t gfp_mask) > +int blkdev_zone_mgmt_all(struct block_device *bdev, unsigned int op, > + gfp_t gfp_mask) > { > struct request_queue *q = bdev_get_queue(bdev); > sector_t capacity = get_capacity(bdev->bd_disk); > @@ -213,8 +213,7 @@ static int blkdev_zone_reset_all_emulated(struct block_device *bdev, > continue; > } > > - bio = blk_next_bio(bio, bdev, 0, REQ_OP_ZONE_RESET | REQ_SYNC, > - gfp_mask); > + bio = blk_next_bio(bio, bdev, 0, op | REQ_SYNC, gfp_mask); > bio->bi_iter.bi_sector = sector; > sector += zone_sectors; > > @@ -231,6 +230,7 @@ static int blkdev_zone_reset_all_emulated(struct block_device *bdev, > kfree(need_reset); > return ret; > } > +EXPORT_SYMBOL_GPL(blkdev_zone_mgmt_all); > > static int blkdev_zone_reset_all(struct block_device *bdev, gfp_t gfp_mask) > { > @@ -295,7 +295,7 @@ int blkdev_zone_mgmt(struct block_device *bdev, enum req_opf op, > */ > if (op == REQ_OP_ZONE_RESET && sector == 0 && nr_sectors == capacity) { > if (!blk_queue_zone_resetall(q)) > - return blkdev_zone_reset_all_emulated(bdev, gfp_mask); > + return blkdev_zone_mgmt_all(bdev, op, gfp_mask); > return blkdev_zone_reset_all(bdev, gfp_mask); > } > > diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h > index 270cd0c552924..b9baee910b825 100644 > --- a/include/linux/blkdev.h > +++ b/include/linux/blkdev.h > @@ -302,6 +302,8 @@ unsigned int blkdev_nr_zones(struct gendisk *disk); > extern int blkdev_zone_mgmt(struct block_device *bdev, enum req_opf op, > sector_t sectors, sector_t nr_sectors, > gfp_t gfp_mask); > +int blkdev_zone_mgmt_all(struct block_device *bdev, unsigned int op, > + gfp_t gfp_mask); > int blk_revalidate_disk_zones(struct gendisk *disk, > void (*update_driver_data)(struct gendisk *disk)); > -- Damien Le Moal Western Digital Research -- dm-devel mailing list dm-devel@redhat.com https://listman.redhat.com/mailman/listinfo/dm-devel