Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp1709690rdb; Wed, 31 Jan 2024 07:01:19 -0800 (PST) X-Google-Smtp-Source: AGHT+IEC+hWEyoLyIFgjhRmXANFvYpIQLcOBQt5B4gpvpXkHXOntR/ngycjYk7bJQxVnu+5HUJAX X-Received: by 2002:a17:906:eb18:b0:a36:63d6:1861 with SMTP id mb24-20020a170906eb1800b00a3663d61861mr1287928ejb.35.1706713279744; Wed, 31 Jan 2024 07:01:19 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706713279; cv=pass; d=google.com; s=arc-20160816; b=G91ttAB3t+Z2ilo3YSEuRenTVx5vxZOz5gZ94cM79XYnIqa55SXjpDzop8PDaf5LBf fe7k/MZ+2cD1zbmCQKGJ2v9NaBiotJctBaiGUBhsTlHA7TzL7l+msG5ZXv8xu5VtXT8F NVVZ/9KP1HNE4P6o2mIyXLIYtXnwwzOQl4qTCDMOG2GWJmaCjsmyTqim5wqXdWwMLqw0 5doam2JntRFZ4Do+CiKSxF8Re6GWWpUAuQg0FPqxV1qo7D3KIFS9V0oAEO9kp5CwHmaC y+wWuv882p6EyQ25+M9IfW3fRdbiq+tzDDVADfpL3mn7bqf0sX9LPZhn3eY8Q/VLeI/g VL4A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=EFeTZjQEhgBEZLUg6ibjUuFIwmiiAedXiRWCbx5Msz4=; fh=GedVhPYRRvgGkJciRHYtRNjujZIrO8FHIiwm+w37Ml8=; b=dofGbtZ8MwA8tSW+NZ7vQT/sdvbiFGEJ+BMr/ITBvm6u/AcufEFKHwEyZofZI4x9hL O4XTV2I9o39UvljSW6QbEX2gK9dJdCP/2kzm3lvLrtLmQxiL0MvKXEXtqYSp9atWEmIc 9qCxADYIMyrvW5ZHa1cYNQsD+X7bJ9ubC3JgbNjSz4Mzn+Ufh8TVVl183QycazhTnWnR uW3uLvDMGdxSwiIawcJHkWJfe8x6kSvoxXVHZSrk/E9t9xzQsxGTHJpHCgkLY99t3qrm GjQd3havI/Ooeh0Op1gaHVRvXtnyiLgyHrLYP6e/84Pd+AFSytJzegDQidWu61U8C1jy 7cLg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ionos.com header.s=google header.b=MxkNGR+V; arc=pass (i=1 spf=pass spfdomain=ionos.com dkim=pass dkdomain=ionos.com dmarc=pass fromdomain=ionos.com); spf=pass (google.com: domain of linux-kernel+bounces-46650-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-46650-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=ionos.com X-Forwarded-Encrypted: i=1; AJvYcCVVtTI2D8Z4+MUQTgOpqG8Nb1MYrXkOQYyVZhw/mb6LFUX+J7FTR7xT6DalReWsJMohvjHsOETN8lF7RX5Le4vfiw+Lv3HYVDQrpZGR4w== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id n5-20020a170906700500b00a365fbfb493si939985ejj.11.2024.01.31.07.01.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 07:01:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-46650-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@ionos.com header.s=google header.b=MxkNGR+V; arc=pass (i=1 spf=pass spfdomain=ionos.com dkim=pass dkdomain=ionos.com dmarc=pass fromdomain=ionos.com); spf=pass (google.com: domain of linux-kernel+bounces-46650-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-46650-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=ionos.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id D788A1F2B2F4 for ; Wed, 31 Jan 2024 14:54:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C2A9D12FF7C; Wed, 31 Jan 2024 14:50:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ionos.com header.i=@ionos.com header.b="MxkNGR+V" Received: from mail-wr1-f52.google.com (mail-wr1-f52.google.com [209.85.221.52]) (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 B45CA12CD9B for ; Wed, 31 Jan 2024 14:50:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.52 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706712637; cv=none; b=GS1O99NEPLf/oqmsdC7NEdRtU0NeOZR62klct3NqWFawLfOxZdiTV/wJuMqAshdK1PVF64sUJ93dJjqzVH6i0v9XytldVb470edD2aTXKvHFcdhyWfOcE2qvnsd81rP6HbFLcceMcRVJxR+5DZebHUSMtjCPCHl/qMri2+uAuDU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706712637; c=relaxed/simple; bh=6/y0RKR7g9worsePTPRSST8SmwmbabeGMZ/hQjJ+S8E=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=bFIrBsFDrMHkQTRmu+ny0/eK2VdHyjQz7BeQQt0TwiYswY26CS6jkDUvbiy0sbHCDfWwjyDcc6ZGyW5h/ApOv/UCzwilvqoVp687PVzJwiwps03ldBWEjc+0S1FrlZYQzuu1L6BaG/t4zRDSyjjs5GC7qjtNlm+7YylLMOOv/Cs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ionos.com; spf=pass smtp.mailfrom=ionos.com; dkim=pass (2048-bit key) header.d=ionos.com header.i=@ionos.com header.b=MxkNGR+V; arc=none smtp.client-ip=209.85.221.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ionos.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ionos.com Received: by mail-wr1-f52.google.com with SMTP id ffacd0b85a97d-33af40493f4so1832224f8f.3 for ; Wed, 31 Jan 2024 06:50:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ionos.com; s=google; t=1706712631; x=1707317431; 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=EFeTZjQEhgBEZLUg6ibjUuFIwmiiAedXiRWCbx5Msz4=; b=MxkNGR+Vm1kv6dDSLCe4WZKJwdD2arigdg5i2j+xFYEks1P5J5lUh76sycBJZL3eDw XJE4ziF3v+l3ubq0NiBBnYyNjgJN3MMn63tiLV35Djx+H4rBKYiLH0RdbYEDECQ2sEV6 uh7pewJsPc7jYrmMBVuordcwscT3fa5lpgpsH1GuTaUR/WZMWskXdPpsERZ0AToPNxjY udmpB+bY1SUwhMFsHPCy0ccrUMRBr+umNur0UNBOrNKclm78qo5RxDRSlJCTjT5GYKKu Aw4huEX5igUQV5sZnGq9Cu0V8N1nSYR5ZR5TpE67lttQwO+xoRB0xoTIfUXnBE1feU5A iygA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706712631; x=1707317431; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=EFeTZjQEhgBEZLUg6ibjUuFIwmiiAedXiRWCbx5Msz4=; b=AMi6IPpRMWxkEWfaBToUTrBySiRwmRNr/u6sH4T75fiO/zHfTUJJ+1vbqJjU4ldzKW 7P6N9/vzyHp4GCTPkHg9NZXqmNtwx+O6+7J6FekRP6RlPDtxTfcmaqzfaJZZB+QasRCo RlHDnTD2ODP3f0JcYTy3cekqvt3B4kGvN1zhzxjgE6R/RsvdaKhceYHzJlpfesLK3KnW gQJjrTTvokMOA038ZYG3KWASf2h8tjOSoIiI286QQhgAZilglLe5HC9N/RhinJzbfPOQ cd1PZ/ZwKbhcQ6KomHIpPlo5m+EJvgrJwpfdTMxNqraZvDwu9sRITYEi68u4o+rnp6zL T7gg== X-Gm-Message-State: AOJu0YzYsJ6wn1U0UXcfpJLuoE51RAWFXNfXpQRx+IJ37wMB64dTvbl6 gF609IaI/CxK4RVqq8T2u5x7OnAZvX1mcg/a02zGurU8VPeonYbg6kvIHQloSfJ98SqiIJ48Tbs d X-Received: by 2002:a5d:4ac4:0:b0:337:7086:b6f3 with SMTP id y4-20020a5d4ac4000000b003377086b6f3mr1346308wrs.21.1706712631671; Wed, 31 Jan 2024 06:50:31 -0800 (PST) Received: from raven.blarg.de (p200300dc6f2f5c00023064fffe740809.dip0.t-ipconnect.de. [2003:dc:6f2f:5c00:230:64ff:fe74:809]) by smtp.gmail.com with ESMTPSA id ch15-20020a5d5d0f000000b0033905a60689sm13850173wrb.45.2024.01.31.06.50.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 06:50:31 -0800 (PST) From: Max Kellermann To: linux-kernel@vger.kernel.org Cc: Max Kellermann Subject: [PATCH 19/28] bio.h: move bio_has_data() and bio_no_advance_iter() to blk_types.h Date: Wed, 31 Jan 2024 15:49:59 +0100 Message-Id: <20240131145008.1345531-20-max.kellermann@ionos.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240131145008.1345531-1-max.kellermann@ionos.com> References: <20240131145008.1345531-1-max.kellermann@ionos.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit "struct bio" has nothing to do with "bio.h", the naming is just confusing. This move will allow narrowing other dependencies later. Signed-off-by: Max Kellermann --- include/linux/bio.h | 22 ---------------------- include/linux/blk_types.h | 23 +++++++++++++++++++++++ 2 files changed, 23 insertions(+), 22 deletions(-) diff --git a/include/linux/bio.h b/include/linux/bio.h index afae5a73b7cd..b8562d4b57b2 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h @@ -49,28 +49,6 @@ static inline unsigned int bio_max_segs(unsigned int nr_segs) #define bio_data_dir(bio) \ (op_is_write(bio_op(bio)) ? WRITE : READ) -/* - * Check whether this bio carries any data or not. A NULL bio is allowed. - */ -static inline bool bio_has_data(struct bio *bio) -{ - if (bio && - bio->bi_iter.bi_size && - bio_op(bio) != REQ_OP_DISCARD && - bio_op(bio) != REQ_OP_SECURE_ERASE && - bio_op(bio) != REQ_OP_WRITE_ZEROES) - return true; - - return false; -} - -static inline bool bio_no_advance_iter(const struct bio *bio) -{ - return bio_op(bio) == REQ_OP_DISCARD || - bio_op(bio) == REQ_OP_SECURE_ERASE || - bio_op(bio) == REQ_OP_WRITE_ZEROES; -} - static inline void *bio_data(struct bio *bio) { if (bio_has_data(bio)) diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h index ad48c3f5ddd6..313db4b9b49e 100644 --- a/include/linux/blk_types.h +++ b/include/linux/blk_types.h @@ -284,6 +284,7 @@ struct bio { #define BIO_RESET_BYTES offsetof(struct bio, bi_max_vecs) #define BIO_MAX_SECTORS (UINT_MAX >> SECTOR_SHIFT) + /* * bio flags */ @@ -434,6 +435,28 @@ static inline enum req_op bio_op(const struct bio *bio) return bio->bi_opf & REQ_OP_MASK; } +/* + * Check whether this bio carries any data or not. A NULL bio is allowed. + */ +static inline bool bio_has_data(struct bio *bio) +{ + if (bio && + bio->bi_iter.bi_size && + bio_op(bio) != REQ_OP_DISCARD && + bio_op(bio) != REQ_OP_SECURE_ERASE && + bio_op(bio) != REQ_OP_WRITE_ZEROES) + return true; + + return false; +} + +static inline bool bio_no_advance_iter(const struct bio *bio) +{ + return bio_op(bio) == REQ_OP_DISCARD || + bio_op(bio) == REQ_OP_SECURE_ERASE || + bio_op(bio) == REQ_OP_WRITE_ZEROES; +} + static inline bool blk_op_is_passthrough(blk_opf_t op) { op &= REQ_OP_MASK; -- 2.39.2