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=-20.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable 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 5E450C47E4E for ; Tue, 6 Jul 2021 11:34:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4D7B461C27 for ; Tue, 6 Jul 2021 11:34:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237548AbhGFLgN (ORCPT ); Tue, 6 Jul 2021 07:36:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:35442 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233939AbhGFL0e (ORCPT ); Tue, 6 Jul 2021 07:26:34 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7966B61D58; Tue, 6 Jul 2021 11:19:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1625570392; bh=C7djTTCjYd0cKj88eqwliCRjLiPRX/To8ipnMZj28IM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=g8DFE81zkZ//PukuJemB3fr9eLwcAFxpkpzYG01MHcOugFmem//1x6YBgqvric/rJ Y5TdZAnz7nlFHQ+Uj6H/jSkaVeGCd6DQbcOgfxUYPAheCZEvlvQBxeeEaJCj6kjCN2 q+wxmPBU2ZYtd9LgVX1w+IEMIXV+kpwmStvpLdR+RmekMltVXRCsjo2r2RvqEZ2Ar6 TnFqf+G/m0PKbjzAO5FCP+hgW8WPTNkPbambeLG8z6sJXVZ6IvZQcoaxpopKgT9Iqb wkrdgIoDrQ06U494iHtidnLwwWvH2HWGOAey1SaeBlMX2dfZhKXeqQ00m3mZAkyr1L rwNPqce5DFNgA== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Damien Le Moal , Christoph Hellwig , Hannes Reinecke , Chaitanya Kulkarni , Himanshu Madhani , Jens Axboe , Mike Snitzer , Sasha Levin , linux-block@vger.kernel.org Subject: [PATCH AUTOSEL 5.12 064/160] block: introduce BIO_ZONE_WRITE_LOCKED bio flag Date: Tue, 6 Jul 2021 07:16:50 -0400 Message-Id: <20210706111827.2060499-64-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210706111827.2060499-1-sashal@kernel.org> References: <20210706111827.2060499-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Damien Le Moal [ Upstream commit 9ffbbb435d8f566a0924ce4b5dc7fc1bceb6dbf8 ] Introduce the BIO flag BIO_ZONE_WRITE_LOCKED to indicate that a BIO owns the write lock of the zone it is targeting. This is the counterpart of the struct request flag RQF_ZONE_WRITE_LOCKED. This new BIO flag is reserved for now for zone write locking control for device mapper targets exposing a zoned block device. Since in this case, the lock flag must not be propagated to the struct request that will be used to process the BIO, a BIO private flag is used rather than changing the RQF_ZONE_WRITE_LOCKED request flag into a common REQ_XXX flag that could be used for both BIO and request. This avoids conflicts down the stack with the block IO scheduler zone write locking (in mq-deadline). Signed-off-by: Damien Le Moal Reviewed-by: Christoph Hellwig Reviewed-by: Hannes Reinecke Reviewed-by: Chaitanya Kulkarni Reviewed-by: Himanshu Madhani Acked-by: Jens Axboe Signed-off-by: Mike Snitzer Signed-off-by: Sasha Levin --- include/linux/blk_types.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h index db026b6ec15a..e5cf12f102a2 100644 --- a/include/linux/blk_types.h +++ b/include/linux/blk_types.h @@ -304,6 +304,7 @@ enum { BIO_CGROUP_ACCT, /* has been accounted to a cgroup */ BIO_TRACKED, /* set if bio goes through the rq_qos path */ BIO_REMAPPED, + BIO_ZONE_WRITE_LOCKED, /* Owns a zoned device zone write lock */ BIO_FLAG_LAST }; -- 2.30.2