From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f100.google.com (mail-pj1-f100.google.com [209.85.216.100]) (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 625533749F0 for ; Sat, 27 Jun 2026 05:42:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.100 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782538970; cv=none; b=eDGJDbiRfhn/tzP9d8Z+24+XqsW1vkRzXWjSwKFutY3pHECVHFhHtO7J6sMae3te/pZzKNoxuw/ofbsxNdTQyxRu3HPX36/yQO9aHwgxOzr4GgkrnZanksrJd1nMwEjAgPhulKp6pqSvGq58nKPqPpiInIv4WzfIUh8Sb9FfcGw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782538970; c=relaxed/simple; bh=9h7ZEz78Y6ScMBC88C8RHAAfRQ3ckL8zd/zOxP8SyRY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Yk66bKG+h6vGfoqmiZxxZnXUCBkGxBs5D2QwgRTJCDGSZXuv7sqZSODaFsSZRTjXifv3p6Lf6cpoigFoL9sgapep0fmQWDnP4DYzZX8rceIqCKS06SaiTywVdxkXCEfoPhvTYS1LiNDzVAnSwDOebuBNj94PO7YA4EVMRfxEgXw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=purestorage.com; spf=pass smtp.mailfrom=purestorage.com; dkim=pass (2048-bit key) header.d=purestorage.com header.i=@purestorage.com header.b=KHBEvlsj; arc=none smtp.client-ip=209.85.216.100 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=purestorage.com Authentication-Results: smtp.subspace.kernel.org; spf=pass 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="KHBEvlsj" Received: by mail-pj1-f100.google.com with SMTP id 98e67ed59e1d1-37e1657510bso111710a91.2 for ; Fri, 26 Jun 2026 22:42:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=purestorage.com; s=google2022; t=1782538968; x=1783143768; 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:content-type; bh=hJetzVCmipfxkIYaKGKmSSwqDl0tCRIuzU++fp89zak=; b=KHBEvlsj0AlvZ3tbCDrQwsZVc7TatkU9GOkSwpfGbO6ZlT7v47ERnBptLAwtNjVMkC FloXWLYQ5bZYXN4gT0GojAmmpnsCSj1JoagXyfDPT3NWx7yq5Yp+T7UARxJqe/PL5ZqK 5cQEjxpvCo5ny9jhyMTfTGmLyUQwsgEeL7w8EYXIIYRt/FA0E2K1n46ZcqGqoqBJXZRI PebI0CRJQ0f7JXr7s2ZF9lUnsQkhhY+x2gmBaJ/HcQf0Z1CO54ldWHHxzeJs0SrQ5Ype LHXchCqaeS2w+gCrrYDXFmfDK+IeAjBKVUnJtPm0fJ3qD3LTgFSiEjIVJhYvJWDnAP/g esXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782538968; x=1783143768; 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:content-type; bh=hJetzVCmipfxkIYaKGKmSSwqDl0tCRIuzU++fp89zak=; b=DTsNkadQ1un92cDExL7gvj5pLuMqWgl1v3tu9Z40xXf+YLPf7SVFk96Ww0QT8x3TsA CGKzYfgk3RPM5+4+M7YsSMpvutoA55xbVxvA+wweregWrzivWCbnbk4HLI+nq0MO8bP7 wam/Bp9kDLuC56KjEtEuySW2DIG/TzUb+mmtH4scepw1Uo80+caLD6IwbABjNYazRPfd mUJVrXD+Wq/lGZglCYzokYQCMdaHtCTCUUsquVjiWs2DhXwuJuCQixBa+IT21/tKGH53 ZNW58448uc8x70/9qEBqDQtn7GiBilGxyndaw9BOdJSW/zSFQC2W9v6SWIc2Nz0M78lh Miog== X-Forwarded-Encrypted: i=1; AHgh+RqxDZec8OY0npJjziu20grrEIRI56rxAgDTt4RQBEZz/IRdR1JSCtSyHEkf2309CAmBilqZIP7W+jwAldw=@vger.kernel.org X-Gm-Message-State: AOJu0Yy5HYwdFPhnFq6Ob3fWPgqLASxLCLRAk0LqZdyP6TruL78M/fi7 Qt4pdYEtVm+WkoQH7Fn10nRxOLip/f5nOFYwDuE6ieOKbLmPmHY4EBh3Dn8AVh65UoYqUlRWQI8 2Rbb3JRxeA1Gc3iLrOz5xr+co1qNTlNu/vBmvVMun9wGSFJbYr/mU X-Gm-Gg: AfdE7cn/r5EehiJR679E3rOVFVsyK/NKM70y2WPrLeGQQzV0Qykxku/I4PMJW5FTHiy WngXmUhdgdZRaoSLB43UAe6veHAmYV6nUtj1KSEGCs09J07Z0nRCbZxaXJK0e3LfR5+m9V1xlXZ RxMI68jTktmoQgWLxantIP03B/rIRDP4wszdYfiSIs6aDY7e47p5ztySoQHQNA2gbHI2HWY09/a yf0IP4xK8LBRVv6p+9ep2QNfDhjSzjPzpBzKvr7lZ8iyU4qNz9BYFZcmn4t3WIfS0kttE2Xd7ma VfB4HCZ7OZsijEk4ugysOnWUF74P4EXucsTJGp40sG8xT+M6A3F48U3VYVBdkKJylmv3+nqBuEG +GPVXck1/Yz1m261Ts5DA2Z6K8rrM X-Received: by 2002:a17:90b:53c3:b0:36b:9231:9718 with SMTP id 98e67ed59e1d1-37dfa2c9951mr5148619a91.6.1782538967568; Fri, 26 Jun 2026 22:42:47 -0700 (PDT) Received: from c7-smtp-2026.dev.purestorage.com ([2620:125:9017:12:36:3:6:0]) by smtp-relay.gmail.com with ESMTPS id 98e67ed59e1d1-37df39562besm848289a91.1.2026.06.26.22.42.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Jun 2026 22:42:47 -0700 (PDT) X-Relaying-Domain: purestorage.com Received: from dev-csander.dev.purestorage.com (dev-csander.dev.purestorage.com [10.112.12.104]) by c7-smtp-2026.dev.purestorage.com (Postfix) with ESMTP id E8FAD402B5; Fri, 26 Jun 2026 23:42:46 -0600 (MDT) Received: by dev-csander.dev.purestorage.com (Postfix, from userid 1557716354) id E6AE6E40712; Fri, 26 Jun 2026 23:42:46 -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 v4 4/5] t10-pi: use bio_integrity_intervals() helper Date: Fri, 26 Jun 2026 23:42:19 -0600 Message-ID: <20260627054220.2174166-5-csander@purestorage.com> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260627054220.2174166-1-csander@purestorage.com> References: <20260627054220.2174166-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.54.0