[Devel] [PATCH 5/6] ploop: Remove now unused PLOOP_E_ZERO_INDEX and PLOOP_E_DELTA_ZERO_INDEX branches

Kirill Tkhai ktkhai at virtuozzo.com
Tue Apr 30 13:03:50 MSK 2019


These flags are never set anymore, so the patch
kills all unused branches under them.

Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
---
 drivers/block/ploop/dev.c   |   52 -------------------------------------------
 include/linux/ploop/ploop.h |    3 --
 2 files changed, 55 deletions(-)

diff --git a/drivers/block/ploop/dev.c b/drivers/block/ploop/dev.c
index 333f02adcf5c..18ffb1092ff8 100644
--- a/drivers/block/ploop/dev.c
+++ b/drivers/block/ploop/dev.c
@@ -2296,58 +2296,6 @@ static void ploop_req_state_process(struct ploop_request * preq)
 					 &sbl, cluster_size_in_sec(plo));
 		break;
 	}
-	case PLOOP_E_ZERO_INDEX:
-	{
-		preq->eng_state = PLOOP_E_DATA_WBI;
-		top_delta = ploop_top_delta(plo);
-		plo->st.bio_out++;
-		if (whole_block(plo, preq)) {
-			top_delta->io.ops->submit(&top_delta->io, preq, preq->req_rw,
-						  &preq->bl, preq->iblock,
-						  preq->req_size);
-		} else {
-			struct bio_list sbl;
-			struct bio * b;
-			int i;
-
-			if (!preq->aux_bio)
-				preq->aux_bio = bio_alloc(GFP_NOFS, block_vecs(plo));
-
-			if (!preq->aux_bio ||
-			    fill_bio(plo, preq->aux_bio, preq->req_cluster)) {
-				PLOOP_REQ_FAIL_IMMEDIATE(preq, -ENOMEM);
-				break;
-			}
-
-			for (i = 0; i < preq->aux_bio->bi_vcnt; i++)
-				memset(page_address(preq->aux_bio->bi_io_vec[i].bv_page),
-				       0, PAGE_SIZE);
-
-			bio_list_for_each(b, &preq->bl) {
-				bio_bcopy(preq->aux_bio, b, plo);
-			}
-
-			sbl.head = sbl.tail = preq->aux_bio;
-			top_delta->io.ops->submit(&top_delta->io, preq, preq->req_rw,
-						  &sbl, preq->iblock, cluster_size_in_sec(plo));
-		}
-		break;
-	}
-	case PLOOP_E_DELTA_ZERO_INDEX:
-	{
-		struct bio_list sbl;
-
-		BUG_ON (preq->aux_bio == NULL);
-
-		preq->eng_state = PLOOP_E_DATA_WBI;
-		sbl.head = sbl.tail = preq->aux_bio;
-		top_delta = ploop_top_delta(plo);
-		plo->st.bio_out++;
-		top_delta->io.ops->submit(&top_delta->io, preq, preq->req_rw,
-					  &sbl, preq->iblock,
-					  cluster_size_in_sec(plo));
-		break;
-	}
 	case PLOOP_E_RELOC_DATA_READ:
 	{
 		struct bio_list sbl;
diff --git a/include/linux/ploop/ploop.h b/include/linux/ploop/ploop.h
index 8e17d0918e4a..eea75663fa4e 100644
--- a/include/linux/ploop/ploop.h
+++ b/include/linux/ploop/ploop.h
@@ -518,9 +518,6 @@ enum
 	PLOOP_E_DATA_WBI,	/* Data writeback is in progress and index
 				 * is not updated.
 				 */
-	PLOOP_E_ZERO_INDEX,	/* Zeroing index of free block; original request
-				   can use .submit on completion */
-	PLOOP_E_DELTA_ZERO_INDEX,/* the same but for PLOOP_E_DELTA_READ */
 	PLOOP_E_FSYNC_PENDED,   /* INDEX_WB needs io->ops->sync() to proceed */
 };
 



More information about the Devel mailing list