From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f99.google.com (mail-pj1-f99.google.com [209.85.216.99]) (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 A06FD2D3A75 for ; Fri, 17 Apr 2026 01:57:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.99 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776391071; cv=none; b=TCFpQt9TeZTQPhSgg8C9g09nTMV3kMPuBpCeB9DGcovWecTX9PI7LV8SChzzUWE1TLkEBcBvFNXCXc8joyx9mEFQ7wLHHgEedV8Dkn3wxiSK1jXpNBGn53ttOnKQLi90rPB+SE1cShM2z0r7aKGhH3kXJKtDqZGdf+RFV9Zre7A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776391071; c=relaxed/simple; bh=D1sF5rCpyJ8v1Q/Gw4hLl9PjXnZwN2O7sQ73iHxyGO4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=XMqCPsTVt7oIfbP2klb0Wzx9Xe9sYiQ6saRAvwquUYGo+prTz4OIQYpC26SyX9RLLS4FS9xP/5onSwqQXftNj8m3wLxVtgtLHoiZK1vgVtFekjx1W4UDoQvhUkBAZrd+8odlZ97Q0cekR9xL2EDczboDA3qNVsNSk1+/JNbl/90= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=purestorage.com; spf=fail smtp.mailfrom=purestorage.com; dkim=pass (2048-bit key) header.d=purestorage.com header.i=@purestorage.com header.b=AFvkSnDU; arc=none smtp.client-ip=209.85.216.99 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=purestorage.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=purestorage.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=purestorage.com header.i=@purestorage.com header.b="AFvkSnDU" Received: by mail-pj1-f99.google.com with SMTP id 98e67ed59e1d1-35daa02ea08so14264a91.2 for ; Thu, 16 Apr 2026 18:57:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=purestorage.com; s=google2022; t=1776391062; x=1776995862; 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=ePLDDsMaoT6WX22t4kx7uDAhAvj4BaoTe7M9oy5w3tM=; b=AFvkSnDUcK3u1Z91caVhRRC7hPOoHYN5oMUDYLNsn1oapZb2taaVA74MEYy3uy1u2s mkA0uFhcwjmNZrN3CJKgLYa05x/RXD/8mvlp48UXaYdGnqNz0HFZs9tH+R9cPrVtmJVi R7rwtpxbDoq6HX6DHaNz9/yAOVUvy0r+fLX4LUhYB261yQc5rOV0aswngv945idzpHoN 5/7DAN5v+81jzxH4wFidWM3vpGVwB2oLYb1BAHkdlTq0yE8PUfJdWcEHQXeweCtbbMrj ya+0cEmczxyk9+BV3fWb13UX03yrFNTzRv6/4ixTBeNXVmYkwJBfW/8hQ/y9FxVzd8Rf q5Pg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776391062; x=1776995862; 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=ePLDDsMaoT6WX22t4kx7uDAhAvj4BaoTe7M9oy5w3tM=; b=A/RyfgZWiOQHdXhf+CGdpJ9tcEf6Exc8rwtsFpOQS8LiiL6UAZDEmq/GUT32sMtZ/d shAaeMA6Nct6giSxJ5HNZwuJv2z/UABQ/eeU7SxlzgVEcocFMxL7yJPED9Bc3X+dJswM D+om4MeHzgp+Bti+MFJQ5udsIjChX5Ja8mm0Z2UnizAQVP8bfMxBCBZmFPvG2rcpdZR5 XJAupVuJ38C1du3I2h4LK2cDbnlXW72NNrwWUomt2LDZRNUyyXe4GsruHGTCS/irnqFr 91fMZ4/ewgGVnvn4qT6+gOVw6fri+L6u1TuEdmYCfRXfjgJ5rh8TgzxHtnH/6T8rtTks 46Mg== X-Forwarded-Encrypted: i=1; AFNElJ8DjgTzaIi4StMbf6X8GLPAr+g6dzrfmthVhpm8W9zfuOS0JXLtMmiqw5Cw2/2KUygiUnH55YMf4SFKaUg=@vger.kernel.org X-Gm-Message-State: AOJu0YwMXMEVttce+FmhmsupbmHkjS3JHQFYd1VifaZEuIj3wfuEM8qr Za+Kmi3TMvTdXBBJguM1Wru5gxYaGpHaqwNyvPfE2o0awM6rfzhganb+Ev7RqqGceT+1N8H7Cci kpCU2KSXbs8eC1kqro6gg9SikiM24hDYC6caI X-Gm-Gg: AeBDiesX0VNPNWqh3mevMjCLgqJqMyPyPZKMivP6eH6HB6eHmpijH0QuKG/h6YmM3PD O7QwVT/NcZhBExxh6HC5+7abTQPWfi4DhV5w/KVGr5cpufWrlWCfy2VEWrEutYrD+V69rZ3X8n6 eqzvNuIfUM0vngHfPDGTCGkN1vIKXr0PdEqIvmVaqvK+LDmRA+OISAAHx5ku1tsaQJxJyUEFNMq 92NyAx0dm5KlhwnHtcusu/gM0E1XIcRng4Do0zgqKNtpKMWDpK+1CAfsJ+Yy8OT5Bkniw63o5Pf 18D0uEui49KrXMcq1nSbDe4zhvCyTV9wccsLTryFXanTQOR0lV8VsN5rTBzQd0jlnu+m6O5ondP dZgrmPBcUjQXmWMS/NbYrzxacjiiSXnNhOHNoGjzifoL3VRsEfp6om8dwQEQ7Thsl X-Received: by 2002:a17:902:b68f:b0:2b2:48a5:45c3 with SMTP id d9443c01a7336-2b5f9eceb6amr2890535ad.1.1776391062085; Thu, 16 Apr 2026 18:57:42 -0700 (PDT) Received: from c7-smtp-2023.dev.purestorage.com ([208.88.159.129]) by smtp-relay.gmail.com with ESMTPS id d9443c01a7336-2b5faa0fa70sm233095ad.14.2026.04.16.18.57.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Apr 2026 18:57:42 -0700 (PDT) X-Relaying-Domain: purestorage.com Received: from dev-csander.dev.purestorage.com (dev-csander.dev.purestorage.com [10.112.29.101]) by c7-smtp-2023.dev.purestorage.com (Postfix) with ESMTP id 658EC3406AA; Thu, 16 Apr 2026 19:57:41 -0600 (MDT) Received: by dev-csander.dev.purestorage.com (Postfix, from userid 1557716354) id 60208E406BE; Thu, 16 Apr 2026 19:57:40 -0600 (MDT) From: Caleb Sander Mateos To: Jens Axboe , Christoph Hellwig , Sagi Grimberg , Chaitanya Kulkarni , "Martin K. Petersen" Cc: Anuj Gupta , linux-block@vger.kernel.org, linux-nvme@lists.infradead.org, linux-scsi@vger.kernel.org, target-devel@vger.kernel.org, linux-kernel@vger.kernel.org, Caleb Sander Mateos Subject: [PATCH v3 5/6] t10-pi: use bio_integrity_intervals() helper Date: Thu, 16 Apr 2026 19:57:31 -0600 Message-ID: <20260417015732.2692434-6-csander@purestorage.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20260417015732.2692434-1-csander@purestorage.com> References: <20260417015732.2692434-1-csander@purestorage.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 Use bio_integrity_intervals() to convert blk_rq_pos(rq) to integrity intervals to reduce code duplication. Signed-off-by: Caleb Sander Mateos Reviewed-by: Anuj Gupta Reviewed-by: Christoph Hellwig --- block/t10-pi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/t10-pi.c b/block/t10-pi.c index e58d5eb6cefb..787950dec50a 100644 --- a/block/t10-pi.c +++ b/block/t10-pi.c @@ -541,11 +541,11 @@ static void __blk_reftag_remap(struct bio *bio, struct blk_integrity *bi, static void blk_integrity_remap(struct request *rq, unsigned int nr_bytes, bool prep) { struct blk_integrity *bi = &rq->q->limits.integrity; - u64 ref = blk_rq_pos(rq) >> (bi->interval_exp - SECTOR_SHIFT); + u64 ref = bio_integrity_intervals(bi, blk_rq_pos(rq)); unsigned intervals = nr_bytes >> bi->interval_exp; struct bio *bio; if (!(bi->flags & BLK_INTEGRITY_REF_TAG)) return; -- 2.45.2