From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pg1-f226.google.com (mail-pg1-f226.google.com [209.85.215.226]) (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 CC5CC3D3D1F for ; Fri, 3 Apr 2026 19:41:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.226 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775245285; cv=none; b=R7bUoePEVsP31o62KhwU5y3JG31+/m0cde3DS5M2voo54hnkfc4ie7jPPtazRjYm7eUFiWLHtyGtDYR29mp33HKQgZtyzKBXc8bBYJ7zWo7JiDPziQa+AYvxkoi8cZwT8UgTbbaI1yGuW8CK5qkQJqd5mKGN/djC1txaAK+3AVI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775245285; c=relaxed/simple; bh=3X8FVNCusqycQp84YyxWQtssypswH6QLhLTJE0aKENM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=XmyTUJJEHZEDyAN/vKkp7CV4S0eXSfPxfJ0v3VDIgq6fSTiSw7N3zVj+N3Md4uJu3BWH4mR1+78fvBFUKFH4B+rc76Um4dIcLo1D0nA3BbGqU2enZRCvaq4WZgzQIQx/AffUJXrdKhvEbF3QsP+LhIm3LAS0j1eiGeeN5cI/FLk= 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=Qc2Jf0oU; arc=none smtp.client-ip=209.85.215.226 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="Qc2Jf0oU" Received: by mail-pg1-f226.google.com with SMTP id 41be03b00d2f7-c741c1a656aso133011a12.3 for ; Fri, 03 Apr 2026 12:41:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=purestorage.com; s=google2022; t=1775245282; x=1775850082; 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=FBT4yhY9HCpI609RSvOs0NG7s5YjLQ+PXcfiCvwv9X4=; b=Qc2Jf0oUPwOX5x18L+T6AtHmmvUM/LGEgchVQPfoPiyPBNZI20CiqiQOMEHqgW6VmN IDhYEc/istquK+3cbLEOcdQhxZwEIGzO3KNx+kvZ25jlnlO6OQr0Gns5p9B4zhcRMFhr QzIVqD8yxEPf9z6KzdQHBXMuwIi4ylmbzynmjmuS/bjYrDQX2vQHQVOl1WGjPETYM6Hq asja5Ze3I5GEl3o6FzyDQplyD/7cd2u23CL3FbPFOYiEg8tpW2Z3TZTEqwDUbRRVmvOu MMG2aibMnIDdhRIOXctl7s86IBX5jjpOYvsWyOvQdoB94k4jZ1LX45XbdtRIb3D3IQSs vsYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775245282; x=1775850082; 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=FBT4yhY9HCpI609RSvOs0NG7s5YjLQ+PXcfiCvwv9X4=; b=cOGo7tT5NSGOAuwYlTFcPAyzhprn6F/FBit8dEOupi31QAoYGyjSKVSqgF6Oa8vwzT e4hckHqxtT8zjYCxvUfMorXZJC9nEeKrzrHN/FfXTPFkx+kCplx8Y89RS7A9sFmB/oPw aoPo7jjCjxzHFnNdDv/VmUzv9qCpa1vjtC3eS9N603D6Amw31gCPZt5yd+8jI9wS2OYL HEKu+tjdOc4tvNRrzSmKzDBeY3RARhU/8Feui/Lf+mvb7MGQoF364IjcZO95FbkZvj0X CfTdRRyXtddQxSE7rSYMyXb54F9uCJ5fYz0hgkJ4CSV1J/PrwaUdGJilTcoSoVTm3rS9 bMLg== X-Forwarded-Encrypted: i=1; AJvYcCVk8LYunFiDu+p+xdZ5DXj6SevPyT8FCQJGYX0IskOzjQZv6l1OJ5QYVV7bgJs9Xcam3PpNTEpTn8nIQXw=@vger.kernel.org X-Gm-Message-State: AOJu0Yyl9FWC5GFfKdx1JVWaiNMqvTNOlqdq9HcYWJNCOdMHSxLtK82N SBojEcWq9IjKeg2FS3YXu8x1g65adVpsxMgB3kiGHfWBlgTAUidw1WljUOMJn9eyv7syEc6pwBM 2g8RdV5iP20LQbmXLF17GNxPXkNQ7R+3uKnDh X-Gm-Gg: AeBDievaBAfIdeTo1ztQkl75L37oxy2rjVSRNarHwCpjfyiFyFLTSFJ3mF2O03eqjPO oGqyaYplNG6O7VvF+tU+wySa73xPXP753wVl24xr2M4+8xHjA/sUe5jnbF1SrOOYVN1cjEOoidJ ZNvC9j97Mgbupb2eKWu05uWqYd4JhRLiEgAxHN+Irj5hKlVEx7faz6drQeMM/Qm/L2Ql39FZfcw k+7jS2QoebwLjj4ITOkjoMJS2qIVmRGh/l0eHYNVEff9pe/GeA5rj9Qqnpua2T9omVAgqTDL53f dN8FNQYiJbTSigqfNpVNf9/yo16k45HzuhcN3MJOYYnQrCV9tAyCasI2Wmi+45vzqtJRkpHluIf R0jtD9KvWkf1mB80fR8Y1oijBIOwuXAI2nWy5pKdTmmqc5VPFbCK4jg== X-Received: by 2002:a17:90b:4b52:b0:359:ff8a:ee4d with SMTP id 98e67ed59e1d1-35de69d98a8mr2252048a91.6.1775245282098; Fri, 03 Apr 2026 12:41:22 -0700 (PDT) Received: from c7-smtp-2023.dev.purestorage.com ([208.88.159.128]) by smtp-relay.gmail.com with ESMTPS id 98e67ed59e1d1-35dd3602d2csm550564a91.2.2026.04.03.12.41.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Apr 2026 12:41:22 -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 583413422E3; Fri, 3 Apr 2026 13:41:21 -0600 (MDT) Received: by dev-csander.dev.purestorage.com (Postfix, from userid 1557716354) id 4EF9EE41AC2; Fri, 3 Apr 2026 13:41:21 -0600 (MDT) From: Caleb Sander Mateos To: Jens Axboe , Christoph Hellwig , Sagi Grimberg , Chaitanya Kulkarni , "Martin K. Petersen" Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org, linux-scsi@vger.kernel.org, target-devel@vger.kernel.org, Caleb Sander Mateos Subject: [PATCH 5/6] t10-pi: use bio_integrity_intervals() helper Date: Fri, 3 Apr 2026 13:41:08 -0600 Message-ID: <20260403194109.2255933-6-csander@purestorage.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20260403194109.2255933-1-csander@purestorage.com> References: <20260403194109.2255933-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 --- 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 36475369cd16..112015cdeb72 100644 --- a/block/t10-pi.c +++ b/block/t10-pi.c @@ -540,11 +540,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