From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-dy1-f228.google.com (mail-dy1-f228.google.com [74.125.82.228]) (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 43C9E1ADC83 for ; Thu, 16 Apr 2026 00:22:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.82.228 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776298972; cv=none; b=t5Lpm/bQagbtmljg67rLIPd7b7L+I6pSAD8TcKjmij3CQ0y1ztqaNn1PCSB7M6+YSqDYD/+mOyCQO0ayRXOMWiiXsLhyhRczkr9R0iMPSG5fKGsFHW80dzJQG6qYuVsKH5BH7ZLcEL1IPEavEjxYp7x+UXxcyeDnHkREfboLWFc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776298972; c=relaxed/simple; bh=D1sF5rCpyJ8v1Q/Gw4hLl9PjXnZwN2O7sQ73iHxyGO4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=R4z9Cgc+20VzfE6QiAGPokW7/k2Prgwh06aIyIG98HkaH998q18n1MFdRFx2pH2U+xxzf70enY6Uf6P1Qub615XTzeygerAzFcUbvZ+GNLFfOp/t/2pbUkCSYwMinLOyEsYI4t07ilVsQRCLzlnYIlheKgG+8AvxKbQ5/Xk7mE0= 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=Z4gt3sjs; arc=none smtp.client-ip=74.125.82.228 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="Z4gt3sjs" Received: by mail-dy1-f228.google.com with SMTP id 5a478bee46e88-2d99367957eso65268eec.1 for ; Wed, 15 Apr 2026 17:22:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=purestorage.com; s=google2022; t=1776298968; x=1776903768; 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=Z4gt3sjs7HJOg5E1Rhbzz43BV0kwY8dMsAmzdD/tuifVtfLydTShtX2/qQmkGD3T30 9Nnejmw1T9pK1E5ePw9Cj15I1zEzIiHzYpKTzMII6xi5ndDVrX/DruADAvAizl+iWQaQ ciaZEKelqJn9pWp3JyMSyDQvBAC18BdebOUSEB1ULtYpfJcXVxxvnxtEUWoLEjmYOpbR L0WDu0VGPzQp3zVukilu42+UvgbPmy2qu7pverMeEWb3Cz7zvxGrhuYoesL8TltK6EjF yWcHkQLPInhgMqX9I3o5OGltw2TWgrzLOv+7RUcZufkaVJxHoxpzg6FeQiJJnSBEJOfb DwmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776298968; x=1776903768; 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=o2L8nQQnxHn0ANvoQ9UZDtZLWD4HZPnNYEzC4WSlQPKwZic4QfhCmsVkYYd8bqxVNq 9eZOfAPIOzvdhUVJkSglcdaD0iBDo+h8rF+fIeFT+yERyJkVkcwDyE4xUy/l4a2kp+3n cWubws+Ss88UIswLs9UapqVxHC93n/mXvUfJGYhaLj1QUr9RQTNVVBuQQunESDk5qZc/ rYRJhcqrRYh5tabKJO+Rg4uMYthISKydeuKAjrRhxLN9ynDK4IS5RPAWF+GZZSjl6yEo iAmVFylI1fBvSM0vLiopugFNjpnVd2wcG/z/aN4lpYF5BfE5SNjuJxzcIEm1/5VCtRBE Tlig== X-Forwarded-Encrypted: i=1; AFNElJ9l9UyLqaxNiaUyUKlFX+Ygqyp7aDIWq3SGwHVhODK/iWKbrpWGjVu0wPH3Ro9FM++dpXl8zrZPb3jHu3I=@vger.kernel.org X-Gm-Message-State: AOJu0YyynAWpGk6C0aPenuzkoraMV540h69Izjs0zr6/2PgEpNQFYRKB Z7Hql1AHGWPhcDnjawxSPNrbkqhjQEZeMd1tz7psDLImWWucwI+mi2fD3Oca4PHDiXttTDF8s+q m4UEZLJsoXWlhQQmg4Mm+OkG2bZQRALZ4k2KF99f24qM6TxJuPo3j X-Gm-Gg: AeBDieuXef+QZ71i4VvKGVlmysn4TI2d0yGVUUdZNpoceqhy16MZu2XuZT1zTYBYQVy M5NczCjTxAumLjZp4/v48+frrko8wnvr3ObGc1jbcfM3C/QaJX2XLb/2tBwEslJN2ZpPjEkaEPH tQycX9aGawsnGO6EzKmp+D73Y3IRURZCLew6gB5bu1I98yJ+Vj3PWctEJlG8tEv+zu5C7r1Fkul aKwDlhxfrYsad+dOADZoDp01/X+5xIgPgvXOG0ebDflsot+Au733ArPrkEBOgCtl9BG+uVdNZKn nhePsJmqGFKhwbK+n+A9wd21JT6YdEADd3ex8OlhTHwZJdozob3TiFxz1fhVMf2PyOenylx3wq9 m9HUIQW6pkoAT8IUvLPF4dqKrUxK+kzER0iSAO3Am2N1USqPNHg== X-Received: by 2002:a05:7300:ac81:b0:2d5:9438:2a02 with SMTP id 5a478bee46e88-2e17d815b51mr60486eec.1.1776298968089; Wed, 15 Apr 2026 17:22:48 -0700 (PDT) Received: from c7-smtp-2023.dev.purestorage.com ([2620:125:9017:12:36:3:5:0]) by smtp-relay.gmail.com with ESMTPS id 5a478bee46e88-2de8ea899b9sm240344eec.18.2026.04.15.17.22.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Apr 2026 17:22:48 -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 49AC33405AE; Wed, 15 Apr 2026 18:22:47 -0600 (MDT) Received: by dev-csander.dev.purestorage.com (Postfix, from userid 1557716354) id 3F4A0E41B93; Wed, 15 Apr 2026 18:22:47 -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 v2 5/6] t10-pi: use bio_integrity_intervals() helper Date: Wed, 15 Apr 2026 18:22:13 -0600 Message-ID: <20260416002214.2048150-6-csander@purestorage.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20260416002214.2048150-1-csander@purestorage.com> References: <20260416002214.2048150-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