From nobody Tue Dec 2 01:41:14 2025 Received: from mail-wr1-f54.google.com (mail-wr1-f54.google.com [209.85.221.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5F67A27FD72 for ; Sun, 23 Nov 2025 22:51:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763938309; cv=none; b=HRi2Mc6wJe2N+fMKwjWhPZsswTfRA5Kayf25hluOIWlj6ryPWkFTr2pwt+QE12IXH5tPi+Yz/mXX3jL2AY7lGFqznWzGFiuNf1xOOp4ix7UjgI3S8cvCpw8Z6fJPi00IDMT1yw98qz7wc/OfUiKZKhRPar3JeMXunPDffZMejYw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763938309; c=relaxed/simple; bh=2QAhGEFKNmLFH3rV8w4M1xXti7VQ8PITqhdQLrQ5sfg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=TrOs1m5yTAUvjtWynYbTxpcycXj7u/MoOoHY5uTBycxMbE8kpnH+qVdXxG9C0Yk3fJjIFGHqoEI2URvNDdVVI52XLlUVfxswDq7VECsvlwCId6uwEo67a0rkWQjYqiL2hqjrri68n2n3OrFNHHbtSBTzKvUswIMygBVSlQAMEGM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=ExMtn78q; arc=none smtp.client-ip=209.85.221.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ExMtn78q" Received: by mail-wr1-f54.google.com with SMTP id ffacd0b85a97d-42b566859ecso3321330f8f.2 for ; Sun, 23 Nov 2025 14:51:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1763938306; x=1764543106; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=g6fykkTkHS7qppZkkxaQlxQiAfIqxjHL5zv+seY74S0=; b=ExMtn78q7qR6pIUKU/7VGEUjfVV6bk4JomIs0V7n3OZ75PBi4JcasAliBmf1wTvoyx b92OsjRkMwvIJuHVXeRbVuryPNFAwkzKf4EGn7EO8szNtfK1k5krVOdZmS8No32ZESGv ImPPNTwX7bmkJ1IhqUNvIU76EZji1bIfOQtq1ljfyidK+oNXUJ7XWwa6MNxvVFiP8HHs B48v9HxDqE527c99oqmHROtvLt21uqMQkqSXO9ArUQjRm7NuOAtbNBiuF1oPNo1YAURf n7K4uaIjeMzrer6TJnVDiPQbQLbmf5Oe9zgZDmAiVIE3QFQMktiqlGywBqIateN1ldED 3Ohw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763938306; x=1764543106; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=g6fykkTkHS7qppZkkxaQlxQiAfIqxjHL5zv+seY74S0=; b=l36hzdf4W1x4KH+fdoysBP7ke8rXPu/e68OQJypWTv0zUgZ7HYnW+UPU95vC2Uqxue CfZdKpE7uavggrxhoxHnpwv4bCzJg+vHQZwVEk6tIx0NU9LEa+FX2OKfA1e7z0IpJVFW hfwnqZLcadLGFNPIsa191+srYR+4wTu9rAUj9vBmx1BeSctqyFhSCwgDFEPvbnT1U2vW Voa+p/dgVBZ/oQnWZbOpW6u0JTkWYbaW9XI0sFxRVEj7Hc86NA89xCsm+CQrKRw7DBFd vAiQV3uCIKzlOUBdtCLCakaajXY5JLou6Dkt7unK/YcY5nt+XJdVoMYyZQZ47Ayw3TGV ak7w== X-Forwarded-Encrypted: i=1; AJvYcCWnp+0hKuWgBFgGz+Cr2/CtoUaYcucQfqCkUGftaqdWpo1wJMsdRiQnaVt+Wjme24rM5ZP/S7sh4d3iSrQ=@vger.kernel.org X-Gm-Message-State: AOJu0YyGwoe9jqi8iaHc10Xm6tNY6DpD4uzOBPN1YP2a1wapsz+Zk3+B wsbZk02h3L4iyl9hOukRmAscxZEyXNt4uVW0Uh/Z/XY8ZHhyiaJgvQfo X-Gm-Gg: ASbGncv2hPbCH11JqVbOFIM57Eq96iS94S5CL3xop/OgAl/UxOAp9uwE0n33oW4YVoz 8IOpDr/fOqIvC8sI6ZiTFa1cxFzddkeG3XcB//8EF0zCRiiUEryu6ugi3494Ud8exfUgFtIomcK Ao0fTeM4drCHLG7ZR10OrtjN2HXLpNI2lRlO4VgDzCtwrDOoPmD09OPrmspkEOQ6yB3T6bx5W5l O6+vyzKNIQLS3d4bBPy4F91BIuuKC/JnYio7RK8E276oTVNQvRJptksmfufoAN5gOz/Na7sfGgq iuOwk1vvioAHMZdl7ACoTEjQB72Zr3MNHfadGoLehPgfE8QMFXcV+11x+i3RLLFIJ/eaXap5C9Q Rqk7Y7Y9grDhxJ+EUnRcp3wBVaVFDpJJpWDtznIevEycQKZ6jR2IngcHtnqv3jn/Ey8O2q/qRpD hmDblxZ5cgt62skg== X-Google-Smtp-Source: AGHT+IG6zETWdv1uNEXL1H7qlBK8rzCntcx0G5cI2YCnUx99f9VimwWWKVBIKAVqjQPLH9huSPPJwA== X-Received: by 2002:a05:6000:1448:b0:429:d3e9:65b with SMTP id ffacd0b85a97d-42cc1d23c3emr9659226f8f.59.1763938305625; Sun, 23 Nov 2025 14:51:45 -0800 (PST) Received: from 127.mynet ([2a01:4b00:bd21:4f00:7cc6:d3ca:494:116c]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-42cb7fb9190sm24849064f8f.33.2025.11.23.14.51.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 23 Nov 2025 14:51:44 -0800 (PST) From: Pavel Begunkov To: linux-block@vger.kernel.org, io-uring@vger.kernel.org Cc: Vishal Verma , tushar.gohad@intel.com, Keith Busch , Jens Axboe , Christoph Hellwig , Sagi Grimberg , Alexander Viro , Christian Brauner , Andrew Morton , Sumit Semwal , =?UTF-8?q?Christian=20K=C3=B6nig?= , Pavel Begunkov , linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org, linux-fsdevel@vger.kernel.org, linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org Subject: [RFC v2 03/11] block: move around bio flagging helpers Date: Sun, 23 Nov 2025 22:51:23 +0000 Message-ID: <6cb3193d3249ab5ca54e8aecbfc24086db09b753.1763725387.git.asml.silence@gmail.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" We'll need bio_flagged() earlier in bio.h in the next patch, move it together with all related helpers, and mark the bio_flagged()'s bio argument as const. Signed-off-by: Pavel Begunkov --- include/linux/bio.h | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/include/linux/bio.h b/include/linux/bio.h index ad2d57908c1c..c75a9b3672aa 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h @@ -46,6 +46,21 @@ static inline unsigned int bio_max_segs(unsigned int nr_= segs) #define bio_data_dir(bio) \ (op_is_write(bio_op(bio)) ? WRITE : READ) =20 +static inline bool bio_flagged(const struct bio *bio, unsigned int bit) +{ + return bio->bi_flags & (1U << bit); +} + +static inline void bio_set_flag(struct bio *bio, unsigned int bit) +{ + bio->bi_flags |=3D (1U << bit); +} + +static inline void bio_clear_flag(struct bio *bio, unsigned int bit) +{ + bio->bi_flags &=3D ~(1U << bit); +} + /* * Check whether this bio carries any data or not. A NULL bio is allowed. */ @@ -225,21 +240,6 @@ static inline void bio_cnt_set(struct bio *bio, unsign= ed int count) atomic_set(&bio->__bi_cnt, count); } =20 -static inline bool bio_flagged(struct bio *bio, unsigned int bit) -{ - return bio->bi_flags & (1U << bit); -} - -static inline void bio_set_flag(struct bio *bio, unsigned int bit) -{ - bio->bi_flags |=3D (1U << bit); -} - -static inline void bio_clear_flag(struct bio *bio, unsigned int bit) -{ - bio->bi_flags &=3D ~(1U << bit); -} - static inline struct bio_vec *bio_first_bvec_all(struct bio *bio) { WARN_ON_ONCE(bio_flagged(bio, BIO_CLONED)); --=20 2.52.0