[Devel] [PATCH 2/6] ploop: Remove now unused PLOOP_REQ_ZERO branches
Kirill Tkhai
ktkhai at virtuozzo.com
Tue Apr 30 13:03:34 MSK 2019
This flag is never set anymore, so the patch
kills all unused branches under it.
Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
---
drivers/block/ploop/dev.c | 5 +----
drivers/block/ploop/events.h | 1 -
drivers/block/ploop/map.c | 19 +------------------
include/linux/ploop/ploop.h | 2 --
4 files changed, 2 insertions(+), 25 deletions(-)
diff --git a/drivers/block/ploop/dev.c b/drivers/block/ploop/dev.c
index 27f4a5b24410..6fcd942004a1 100644
--- a/drivers/block/ploop/dev.c
+++ b/drivers/block/ploop/dev.c
@@ -244,8 +244,6 @@ void ploop_preq_drop(struct ploop_device * plo, struct list_head *drop_list)
put_beancounter(preq->preq_ub);
preq->preq_ub = NULL;
#endif
-
- BUG_ON (test_bit(PLOOP_REQ_ZERO, &preq->state));
ploop_test_and_clear_blockable(plo, preq);
drop_qlen++;
}
@@ -1776,8 +1774,7 @@ static inline bool preq_is_special(struct ploop_request * preq)
PLOOP_REQ_RELOC_A_FL |
PLOOP_REQ_RELOC_S_FL |
PLOOP_REQ_RELOC_N_FL |
- PLOOP_REQ_DISCARD_FL |
- PLOOP_REQ_ZERO_FL);
+ PLOOP_REQ_DISCARD_FL);
}
void ploop_add_req_to_fsync_queue(struct ploop_request * preq)
diff --git a/drivers/block/ploop/events.h b/drivers/block/ploop/events.h
index 62144e1b79d6..2db09d9ac34b 100644
--- a/drivers/block/ploop/events.h
+++ b/drivers/block/ploop/events.h
@@ -44,7 +44,6 @@
{ 1 << PLOOP_REQ_RELOC_A, "RA"}, \
{ 1 << PLOOP_REQ_RELOC_S, "RS"}, \
{ 1 << PLOOP_REQ_RELOC_N, "RN"}, \
- { 1 << PLOOP_REQ_ZERO, "Z"}, \
{ 1 << PLOOP_REQ_DISCARD, "D"})
#define PREQ_FORMAT "preq=0x%p cluster=0x%x iblock=0x%x size=0x%x eng_state=0x%lx state=%s rw=%s"
diff --git a/drivers/block/ploop/map.c b/drivers/block/ploop/map.c
index b8103cfcc79b..e03df205b0ab 100644
--- a/drivers/block/ploop/map.c
+++ b/drivers/block/ploop/map.c
@@ -913,14 +913,6 @@ void ploop_index_update(struct ploop_request * preq)
}
}
- BUG_ON (test_bit(PLOOP_REQ_ZERO, &preq->state) && preq->iblock);
- if (test_bit(PLOOP_REQ_ZERO, &preq->state) && !blk) {
- printk("Either map_node is corrupted or bug in "
- "ploop-balloon (%u)\n", preq->req_cluster);
- PLOOP_REQ_SET_ERROR(preq, -EIO);
- goto corrupted;
- }
-
if (blk == preq->iblock && top_delta->level == old_level)
goto out;
@@ -967,7 +959,6 @@ void ploop_index_update(struct ploop_request * preq)
enomem:
PLOOP_REQ_SET_ERROR(preq, -ENOMEM);
-corrupted:
set_bit(PLOOP_S_ABORT, &plo->state);
out:
preq->eng_state = PLOOP_E_COMPLETE;
@@ -1087,20 +1078,12 @@ static void map_wb_complete(struct map_node * m, int err)
struct ploop_request *pr = preq;
int do_levels_update = 0;
- if (unlikely(test_bit(PLOOP_REQ_ZERO, &preq->state))) {
- BUG_ON (list_empty(&preq->delay_list));
- pr = list_first_entry(&preq->delay_list,
- struct ploop_request,
- list);
- }
-
if (m->levels && m->levels[idx] != top_delta->level) {
spin_lock_irq(&plo->lock);
do_levels_update = 1;
}
- if (unlikely(test_bit(PLOOP_REQ_RELOC_A, &preq->state) ||
- test_bit(PLOOP_REQ_ZERO, &preq->state)))
+ if (unlikely(test_bit(PLOOP_REQ_RELOC_A, &preq->state)))
map_idx_swap(m, idx, &pr->iblock,
ploop_map_log(plo));
else
diff --git a/include/linux/ploop/ploop.h b/include/linux/ploop/ploop.h
index d37d1994434a..752da47e471e 100644
--- a/include/linux/ploop/ploop.h
+++ b/include/linux/ploop/ploop.h
@@ -491,7 +491,6 @@ enum
PLOOP_REQ_RELOC_A, /* 'A' stands for allocate() */
PLOOP_REQ_RELOC_S, /* Obsolete: 'S' stands for submit() */
PLOOP_REQ_RELOC_N, /* 'N' stands for "nullify" */
- PLOOP_REQ_ZERO, /* Obsolete */
PLOOP_REQ_DISCARD, /* Obsolete */
PLOOP_REQ_RSYNC,
PLOOP_REQ_KAIO_FSYNC, /*force image fsync by KAIO module */
@@ -507,7 +506,6 @@ enum
#define PLOOP_REQ_RELOC_S_FL (1 << PLOOP_REQ_RELOC_S) /* Obsolete */
#define PLOOP_REQ_RELOC_N_FL (1 << PLOOP_REQ_RELOC_N)
#define PLOOP_REQ_DISCARD_FL (1 << PLOOP_REQ_DISCARD) /* Obsolete */
-#define PLOOP_REQ_ZERO_FL (1 << PLOOP_REQ_ZERO) /* Obsolete */
enum
{
More information about the Devel
mailing list