Thread (38 messages) 38 messages, 10 authors, 2022-12-08

Re: [PATCH 1/6] block: add support for REQ_OP_VERIFY

From: Chaitanya Kulkarni <hidden>
Date: 2022-07-05 16:50:38
Also in: linux-block, linux-fsdevel, linux-nvme

Darrik,

Thanks for the reply.
quoted
+
+/**
+ * __blkdev_issue_verify - generate number of verify operations
+ * @bdev:	blockdev to issue
+ * @sector:	start sector
+ * @nr_sects:	number of sectors to verify
+ * @gfp_mask:	memory allocation flags (for bio_alloc())
+ * @biop:	pointer to anchor bio
+ *
+ * Description:
+ *  Verify a block range using hardware offload.
+ *
+ * The function will emulate verify operation if no explicit hardware
+ * offloading for verifying is provided.
+ */
+int __blkdev_issue_verify(struct block_device *bdev, sector_t sector,
+		sector_t nr_sects, gfp_t gfp_mask, struct bio **biop)
+{
+	unsigned int max_verify_sectors = bdev_verify_sectors(bdev);
+	sector_t min_io_sect = (BIO_MAX_VECS << PAGE_SHIFT) >> 9;
+	struct bio *bio = *biop;
+	sector_t curr_sects;
+	char *buf;
+
+	if (!max_verify_sectors) {
+		int ret = 0;
+
+		buf = kzalloc(min_io_sect << 9, GFP_KERNEL);
k*z*alloc?  I don't think you need to zero a buffer that we're reading
into, right?

--D
we don't need to but I guess it is just a habit to make sure alloced
buffer is zeored, should I remove it for any particular reason ?

-ck

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help