From: "Martin K. Petersen" <martin.petersen@oracle.com>
To: linux-scsi@vger.kernel.org, axboe@fb.com
Cc: hch@lst.de, sagig@mellanox.com,
"Martin K. Petersen" <martin.petersen@oracle.com>
Subject: [PATCH 06/14] block: Make protection interval calculation generic
Date: Thu, 28 Aug 2014 15:31:24 -0400 [thread overview]
Message-ID: <1409254292-2540-7-git-send-email-martin.petersen@oracle.com> (raw)
In-Reply-To: <1409254292-2540-1-git-send-email-martin.petersen@oracle.com>
Now that the protection interval has been detached from the sector size
we need to be able to handle sizes that are different from 4K and
512. Make the interval calculation generic.
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Sagi Grimberg <sagig@mellanox.com>
---
block/bio-integrity.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/block/bio-integrity.c b/block/bio-integrity.c
index a2b3e994b55b..396244b1e774 100644
--- a/block/bio-integrity.c
+++ b/block/bio-integrity.c
@@ -197,11 +197,7 @@ EXPORT_SYMBOL(bio_integrity_enabled);
static inline unsigned int bio_integrity_intervals(struct blk_integrity *bi,
unsigned int sectors)
{
- /* At this point there are only 512b or 4096b DIF/EPP devices */
- if (bi->interval == 4096)
- return sectors >>= 3;
-
- return sectors;
+ return sectors >> (ilog2(bi->interval) - 9);
}
static inline unsigned int bio_integrity_bytes(struct blk_integrity *bi,
--
1.9.3
next prev parent reply other threads:[~2014-08-28 19:30 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-28 19:31 Block/SCSI data integrity update v3 Martin K. Petersen
2014-08-28 19:31 ` [PATCH 01/14] block: Get rid of bdev_integrity_enabled() Martin K. Petersen
2014-08-28 19:31 ` [PATCH 02/14] block: Replace bi_integrity with bi_special Martin K. Petersen
2014-08-28 19:31 ` [PATCH 03/14] block: Remove integrity tagging functions Martin K. Petersen
2014-08-28 19:31 ` [PATCH 04/14] block: Remove bip_buf Martin K. Petersen
2014-08-28 19:31 ` [PATCH 05/14] block: Deprecate the use of the term sector in the context of block integrity Martin K. Petersen
2014-08-28 19:31 ` Martin K. Petersen [this message]
2014-08-28 19:31 ` [PATCH 07/14] block: Clean up the code used to generate and verify integrity metadata Martin K. Petersen
2014-08-28 19:31 ` [PATCH 08/14] block: Add prefix to block integrity profile flags Martin K. Petersen
2014-08-28 19:31 ` [PATCH 09/14] block: Add a disk flag to block integrity profile Martin K. Petersen
2014-08-28 19:31 ` [PATCH 10/14] block: Relocate bio integrity flags Martin K. Petersen
2014-08-28 19:31 ` [PATCH 11/14] block: Integrity checksum flag Martin K. Petersen
2014-08-28 19:31 ` [PATCH 12/14] block: Don't merge requests if integrity flags differ Martin K. Petersen
2014-08-28 19:31 ` [PATCH 13/14] block: Add T10 Protection Information functions Martin K. Petersen
2014-08-28 19:31 ` [PATCH 14/14] sd: Honor block layer integrity handling flags Martin K. Petersen
2014-08-31 21:17 ` Sagi Grimberg
2014-09-11 0:07 ` Martin K. Petersen
2014-09-11 7:09 ` Sagi Grimberg
2014-09-12 1:35 ` Martin K. Petersen
2014-09-12 13:20 ` Sagi Grimberg
2014-09-12 18:09 ` Martin K. Petersen
2014-08-28 20:10 ` Block/SCSI data integrity update v3 Jens Axboe
2014-08-29 0:43 ` Christoph Hellwig
2014-09-07 16:29 ` Christoph Hellwig
2014-09-08 15:50 ` Jens Axboe
2014-09-11 0:23 ` Martin K. Petersen
2014-09-12 18:16 ` Jens Axboe
-- strict thread matches above, loose matches on Subject: below --
2014-07-25 20:34 Block/SCSI data integrity update v2 Martin K. Petersen
2014-07-25 20:34 ` [PATCH 06/14] block: Make protection interval calculation generic Martin K. Petersen
2014-07-26 15:26 ` Christoph Hellwig
2014-08-06 15:43 ` Sagi Grimberg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1409254292-2540-7-git-send-email-martin.petersen@oracle.com \
--to=martin.petersen@oracle.com \
--cc=axboe@fb.com \
--cc=hch@lst.de \
--cc=linux-scsi@vger.kernel.org \
--cc=sagig@mellanox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).