* [PATCH] block: refactor to use helper
[not found] <CGME20230719121928epcas5p3c2af8016b8ffd5d4cb53238a5528eec8@epcas5p3.samsung.com>
@ 2023-07-19 12:16 ` Nitesh Shetty
2023-07-20 2:58 ` Martin K. Petersen
2023-07-20 22:28 ` Jens Axboe
0 siblings, 2 replies; 3+ messages in thread
From: Nitesh Shetty @ 2023-07-19 12:16 UTC (permalink / raw)
To: Jens Axboe
Cc: martin.petersen, gost.dev, Nitesh Shetty, linux-block, linux-kernel
Reduce some code by making use of bio_integrity_bytes().
Signed-off-by: Nitesh Shetty <nj.shetty@samsung.com>
---
block/bio-integrity.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/block/bio-integrity.c b/block/bio-integrity.c
index 4533eb491661..8f0af7ac8573 100644
--- a/block/bio-integrity.c
+++ b/block/bio-integrity.c
@@ -199,7 +199,6 @@ bool bio_integrity_prep(struct bio *bio)
unsigned long start, end;
unsigned int len, nr_pages;
unsigned int bytes, offset, i;
- unsigned int intervals;
blk_status_t status;
if (!bi)
@@ -224,10 +223,9 @@ bool bio_integrity_prep(struct bio *bio)
!(bi->flags & BLK_INTEGRITY_GENERATE))
return true;
}
- intervals = bio_integrity_intervals(bi, bio_sectors(bio));
/* Allocate kernel buffer for protection data */
- len = intervals * bi->tuple_size;
+ len = bio_integrity_bytes(bi, bio_sectors(bio));
buf = kmalloc(len, GFP_NOIO);
status = BLK_STS_RESOURCE;
if (unlikely(buf == NULL)) {
--
2.34.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] block: refactor to use helper
2023-07-19 12:16 ` [PATCH] block: refactor to use helper Nitesh Shetty
@ 2023-07-20 2:58 ` Martin K. Petersen
2023-07-20 22:28 ` Jens Axboe
1 sibling, 0 replies; 3+ messages in thread
From: Martin K. Petersen @ 2023-07-20 2:58 UTC (permalink / raw)
To: Nitesh Shetty
Cc: Jens Axboe, martin.petersen, gost.dev, linux-block, linux-kernel
Nitesh,
> Reduce some code by making use of bio_integrity_bytes().
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] block: refactor to use helper
2023-07-19 12:16 ` [PATCH] block: refactor to use helper Nitesh Shetty
2023-07-20 2:58 ` Martin K. Petersen
@ 2023-07-20 22:28 ` Jens Axboe
1 sibling, 0 replies; 3+ messages in thread
From: Jens Axboe @ 2023-07-20 22:28 UTC (permalink / raw)
To: Nitesh Shetty; +Cc: martin.petersen, gost.dev, linux-block, linux-kernel
On Wed, 19 Jul 2023 17:46:08 +0530, Nitesh Shetty wrote:
> Reduce some code by making use of bio_integrity_bytes().
>
>
Applied, thanks!
[1/1] block: refactor to use helper
commit: 8f63fef5867fb5e8c29d9c14b6d739bfc1869d32
Best regards,
--
Jens Axboe
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-07-20 22:28 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <CGME20230719121928epcas5p3c2af8016b8ffd5d4cb53238a5528eec8@epcas5p3.samsung.com>
2023-07-19 12:16 ` [PATCH] block: refactor to use helper Nitesh Shetty
2023-07-20 2:58 ` Martin K. Petersen
2023-07-20 22:28 ` Jens Axboe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®