From: Philipp Reisner <philipp.reisner@linbit.com>
To: linux-kernel@vger.kernel.org, Jens Axboe <axboe@kernel.dk>
Cc: drbd-dev@lists.linbit.com
Subject: [PATCH 021/118] drbd: Convert all constants in enum drbd_req_event to upper case
Date: Thu, 25 Aug 2011 17:07:17 +0200 [thread overview]
Message-ID: <1314284934-17999-22-git-send-email-philipp.reisner@linbit.com> (raw)
In-Reply-To: <1314284934-17999-1-git-send-email-philipp.reisner@linbit.com>
From: Andreas Gruenbacher <agruen@linbit.com>
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
---
drivers/block/drbd/drbd_int.h | 10 ++--
drivers/block/drbd/drbd_main.c | 28 ++++++------
drivers/block/drbd/drbd_nl.c | 2 +-
drivers/block/drbd/drbd_receiver.c | 18 ++++----
drivers/block/drbd/drbd_req.c | 84 ++++++++++++++++++------------------
drivers/block/drbd/drbd_req.h | 62 +++++++++++++-------------
drivers/block/drbd/drbd_worker.c | 22 +++++-----
7 files changed, 113 insertions(+), 113 deletions(-)
diff --git a/drivers/block/drbd/drbd_int.h b/drivers/block/drbd/drbd_int.h
index 0ed97ac..0d5c727 100644
--- a/drivers/block/drbd/drbd_int.h
+++ b/drivers/block/drbd/drbd_int.h
@@ -2031,21 +2031,21 @@ static inline void drbd_thread_restart_nowait(struct drbd_thread *thi)
* or implicit barrier packets as necessary.
* increased:
* w_send_barrier
- * _req_mod(req, queue_for_net_write or queue_for_net_read);
+ * _req_mod(req, QUEUE_FOR_NET_WRITE or QUEUE_FOR_NET_READ);
* it is much easier and equally valid to count what we queue for the
* worker, even before it actually was queued or send.
* (drbd_make_request_common; recovery path on read io-error)
* decreased:
* got_BarrierAck (respective tl_clear, tl_clear_barrier)
- * _req_mod(req, data_received)
+ * _req_mod(req, DATA_RECEIVED)
* [from receive_DataReply]
- * _req_mod(req, write_acked_by_peer or recv_acked_by_peer or neg_acked)
+ * _req_mod(req, WRITE_ACKED_BY_PEER or RECV_ACKED_BY_PEER or NEG_ACKED)
* [from got_BlockAck (P_WRITE_ACK, P_RECV_ACK)]
* for some reason it is NOT decreased in got_NegAck,
* but in the resulting cleanup code from report_params.
* we should try to remember the reason for that...
- * _req_mod(req, send_failed or send_canceled)
- * _req_mod(req, connection_lost_while_pending)
+ * _req_mod(req, SEND_FAILED or SEND_CANCELED)
+ * _req_mod(req, CONNECTION_LOST_WHILE_PENDING)
* [from tl_clear_barrier]
*/
static inline void inc_ap_pending(struct drbd_conf *mdev)
diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c
index 878f7d4..c5bb871 100644
--- a/drivers/block/drbd/drbd_main.c
+++ b/drivers/block/drbd/drbd_main.c
@@ -290,7 +290,7 @@ void tl_release(struct drbd_conf *mdev, unsigned int barrier_nr,
/* Clean up list of requests processed during current epoch */
list_for_each_safe(le, tle, &b->requests) {
r = list_entry(le, struct drbd_request, tl_requests);
- _req_mod(r, barrier_acked);
+ _req_mod(r, BARRIER_ACKED);
}
/* There could be requests on the list waiting for completion
of the write to the local disk. To avoid corruptions of
@@ -300,10 +300,10 @@ void tl_release(struct drbd_conf *mdev, unsigned int barrier_nr,
the write acks - which would be a bug and violating write ordering.
To not deadlock in case we lose connection while such requests are
still pending, we need some way to find them for the
- _req_mode(connection_lost_while_pending).
+ _req_mode(CONNECTION_LOST_WHILE_PENDING).
These have been list_move'd to the out_of_sequence_requests list in
- _req_mod(, barrier_acked) above.
+ _req_mod(, BARRIER_ACKED) above.
*/
list_del_init(&b->requests);
@@ -336,8 +336,8 @@ bail:
* @mdev: DRBD device.
* @what: The action/event to perform with all request objects
*
- * @what might be one of connection_lost_while_pending, resend, fail_frozen_disk_io,
- * restart_frozen_disk_io.
+ * @what might be one of CONNECTION_LOST_WHILE_PENDING, RESEND, FAIL_FROZEN_DISK_IO,
+ * RESTART_FROZEN_DISK_IO.
*/
static void _tl_restart(struct drbd_conf *mdev, enum drbd_req_event what)
{
@@ -362,7 +362,7 @@ static void _tl_restart(struct drbd_conf *mdev, enum drbd_req_event what)
tmp = b->next;
if (n_writes) {
- if (what == resend) {
+ if (what == RESEND) {
b->n_writes = n_writes;
if (b->w.cb == NULL) {
b->w.cb = w_send_barrier;
@@ -423,7 +423,7 @@ void tl_clear(struct drbd_conf *mdev)
spin_lock_irq(&mdev->req_lock);
- _tl_restart(mdev, connection_lost_while_pending);
+ _tl_restart(mdev, CONNECTION_LOST_WHILE_PENDING);
/* we expect this list to be empty. */
D_ASSERT(list_empty(&mdev->out_of_sequence_requests));
@@ -433,7 +433,7 @@ void tl_clear(struct drbd_conf *mdev)
r = list_entry(le, struct drbd_request, tl_requests);
/* It would be nice to complete outside of spinlock.
* But this is easier for now. */
- _req_mod(r, connection_lost_while_pending);
+ _req_mod(r, CONNECTION_LOST_WHILE_PENDING);
}
/* ensure bit indicating barrier is required is clear */
@@ -1321,7 +1321,7 @@ static void after_state_ch(struct drbd_conf *mdev, union drbd_state os,
union drbd_state ns, enum chg_state_flags flags)
{
enum drbd_fencing_p fp;
- enum drbd_req_event what = nothing;
+ enum drbd_req_event what = NOTHING;
union drbd_state nsm = (union drbd_state){ .i = -1 };
if (os.conn != C_CONNECTED && ns.conn == C_CONNECTED) {
@@ -1349,12 +1349,12 @@ static void after_state_ch(struct drbd_conf *mdev, union drbd_state os,
nsm.i = -1;
if (ns.susp_nod) {
if (os.conn < C_CONNECTED && ns.conn >= C_CONNECTED)
- what = resend;
+ what = RESEND;
if (os.disk == D_ATTACHING && ns.disk > D_ATTACHING)
- what = restart_frozen_disk_io;
+ what = RESTART_FROZEN_DISK_IO;
- if (what != nothing)
+ if (what != NOTHING)
nsm.susp_nod = 0;
}
@@ -1373,12 +1373,12 @@ static void after_state_ch(struct drbd_conf *mdev, union drbd_state os,
/* case2: The connection was established again: */
if (os.conn < C_CONNECTED && ns.conn >= C_CONNECTED) {
clear_bit(NEW_CUR_UUID, &mdev->flags);
- what = resend;
+ what = RESEND;
nsm.susp_fen = 0;
}
}
- if (what != nothing) {
+ if (what != NOTHING) {
spin_lock_irq(&mdev->req_lock);
_tl_restart(mdev, what);
nsm.i &= mdev->state.i;
diff --git a/drivers/block/drbd/drbd_nl.c b/drivers/block/drbd/drbd_nl.c
index 5b8ebbe..1840cbb8 100644
--- a/drivers/block/drbd/drbd_nl.c
+++ b/drivers/block/drbd/drbd_nl.c
@@ -2022,7 +2022,7 @@ static int drbd_nl_resume_io(struct drbd_conf *mdev, struct drbd_nl_cfg_req *nlp
if (mdev->state.conn < C_CONNECTED)
tl_clear(mdev);
if (mdev->state.disk == D_DISKLESS || mdev->state.disk == D_FAILED)
- tl_restart(mdev, fail_frozen_disk_io);
+ tl_restart(mdev, FAIL_FROZEN_DISK_IO);
}
drbd_resume_io(mdev);
diff --git a/drivers/block/drbd/drbd_receiver.c b/drivers/block/drbd/drbd_receiver.c
index 566317b..1762ef0 100644
--- a/drivers/block/drbd/drbd_receiver.c
+++ b/drivers/block/drbd/drbd_receiver.c
@@ -385,7 +385,7 @@ int drbd_release_ee(struct drbd_conf *mdev, struct list_head *list)
/*
* This function is called from _asender only_
- * but see also comments in _req_mod(,barrier_acked)
+ * but see also comments in _req_mod(,BARRIER_ACKED)
* and receive_Barrier.
*
* Move entries from net_ee to done_ee, if ready.
@@ -1507,7 +1507,7 @@ static int receive_DataReply(struct drbd_conf *mdev, enum drbd_packets cmd, unsi
ok = recv_dless_read(mdev, req, sector, data_size);
if (ok)
- req_mod(req, data_received);
+ req_mod(req, DATA_RECEIVED);
/* else: nothing. handled from drbd_disconnect...
* I don't think we may complete this just yet
* in case we are "on-disconnect: freeze" */
@@ -3279,7 +3279,7 @@ static int receive_state(struct drbd_conf *mdev, enum drbd_packets cmd, unsigned
cs_flags = CS_VERBOSE + (os.conn < C_CONNECTED && ns.conn >= C_CONNECTED ? 0 : CS_HARD);
if (ns.pdsk == D_CONSISTENT && is_susp(ns) && ns.conn == C_CONNECTED && os.conn < C_CONNECTED &&
test_bit(NEW_CUR_UUID, &mdev->flags)) {
- /* Do not allow tl_restart(resend) for a rebooted peer. We can only allow this
+ /* Do not allow tl_restart(RESEND) for a rebooted peer. We can only allow this
for temporal network outages! */
spin_unlock_irq(&mdev->req_lock);
dev_err(DEV, "Aborting Connect, can not thaw IO with an only Consistent peer\n");
@@ -4272,19 +4272,19 @@ static int got_BlockAck(struct drbd_conf *mdev, struct p_header80 *h)
switch (be16_to_cpu(h->command)) {
case P_RS_WRITE_ACK:
D_ASSERT(mdev->net_conf->wire_protocol == DRBD_PROT_C);
- what = write_acked_by_peer_and_sis;
+ what = WRITE_ACKED_BY_PEER_AND_SIS;
break;
case P_WRITE_ACK:
D_ASSERT(mdev->net_conf->wire_protocol == DRBD_PROT_C);
- what = write_acked_by_peer;
+ what = WRITE_ACKED_BY_PEER;
break;
case P_RECV_ACK:
D_ASSERT(mdev->net_conf->wire_protocol == DRBD_PROT_B);
- what = recv_acked_by_peer;
+ what = RECV_ACKED_BY_PEER;
break;
case P_DISCARD_ACK:
D_ASSERT(mdev->net_conf->wire_protocol == DRBD_PROT_C);
- what = conflict_discarded_by_peer;
+ what = CONFLICT_DISCARDED_BY_PEER;
break;
default:
D_ASSERT(0);
@@ -4315,7 +4315,7 @@ static int got_NegAck(struct drbd_conf *mdev, struct p_header80 *h)
found = validate_req_change_req_state(mdev, p->block_id, sector,
&mdev->write_requests, __func__,
- neg_acked, missing_ok);
+ NEG_ACKED, missing_ok);
if (!found) {
/* Protocol A has no P_WRITE_ACKs, but has P_NEG_ACKs.
The master bio might already be completed, therefore the
@@ -4340,7 +4340,7 @@ static int got_NegDReply(struct drbd_conf *mdev, struct p_header80 *h)
return validate_req_change_req_state(mdev, p->block_id, sector,
&mdev->read_requests, __func__,
- neg_acked, false);
+ NEG_ACKED, false);
}
static int got_NegRSDReply(struct drbd_conf *mdev, struct p_header80 *h)
diff --git a/drivers/block/drbd/drbd_req.c b/drivers/block/drbd/drbd_req.c
index 8541b16..b3b1d4e 100644
--- a/drivers/block/drbd/drbd_req.c
+++ b/drivers/block/drbd/drbd_req.c
@@ -225,10 +225,10 @@ void _req_may_be_done(struct drbd_request *req, struct bio_and_error *m)
return;
if (req->master_bio) {
- /* this is data_received (remote read)
+ /* this is DATA_RECEIVED (remote read)
* or protocol C P_WRITE_ACK
* or protocol B P_RECV_ACK
- * or protocol A "handed_over_to_network" (SendAck)
+ * or protocol A "HANDED_OVER_TO_NETWORK" (SendAck)
* or canceled or failed,
* or killed from the transfer log due to connection loss.
*/
@@ -393,11 +393,11 @@ int __req_mod(struct drbd_request *req, enum drbd_req_event what,
/* does not happen...
* initialization done in drbd_req_new
- case created:
+ case CREATED:
break;
*/
- case to_be_send: /* via network */
+ case TO_BE_SENT: /* via network */
/* reached via drbd_make_request_common
* and from w_read_retry_remote */
D_ASSERT(!(req->rq_state & RQ_NET_MASK));
@@ -405,13 +405,13 @@ int __req_mod(struct drbd_request *req, enum drbd_req_event what,
inc_ap_pending(mdev);
break;
- case to_be_submitted: /* locally */
+ case TO_BE_SUBMITTED: /* locally */
/* reached via drbd_make_request_common */
D_ASSERT(!(req->rq_state & RQ_LOCAL_MASK));
req->rq_state |= RQ_LOCAL_PENDING;
break;
- case completed_ok:
+ case COMPLETED_OK:
if (bio_data_dir(req->master_bio) == WRITE)
mdev->writ_cnt += req->i.size >> 9;
else
@@ -424,7 +424,7 @@ int __req_mod(struct drbd_request *req, enum drbd_req_event what,
put_ldev(mdev);
break;
- case write_completed_with_error:
+ case WRITE_COMPLETED_WITH_ERROR:
req->rq_state |= RQ_LOCAL_COMPLETED;
req->rq_state &= ~RQ_LOCAL_PENDING;
@@ -433,7 +433,7 @@ int __req_mod(struct drbd_request *req, enum drbd_req_event what,
put_ldev(mdev);
break;
- case read_ahead_completed_with_error:
+ case READ_AHEAD_COMPLETED_WITH_ERROR:
/* it is legal to fail READA */
req->rq_state |= RQ_LOCAL_COMPLETED;
req->rq_state &= ~RQ_LOCAL_PENDING;
@@ -441,7 +441,7 @@ int __req_mod(struct drbd_request *req, enum drbd_req_event what,
put_ldev(mdev);
break;
- case read_completed_with_error:
+ case READ_COMPLETED_WITH_ERROR:
drbd_set_out_of_sync(mdev, req->i.sector, req->i.size);
req->rq_state |= RQ_LOCAL_COMPLETED;
@@ -459,12 +459,12 @@ int __req_mod(struct drbd_request *req, enum drbd_req_event what,
break;
}
- /* _req_mod(req,to_be_send); oops, recursion... */
+ /* _req_mod(req,TO_BE_SENT); oops, recursion... */
req->rq_state |= RQ_NET_PENDING;
inc_ap_pending(mdev);
- /* fall through: _req_mod(req,queue_for_net_read); */
+ /* fall through: _req_mod(req,QUEUE_FOR_NET_READ); */
- case queue_for_net_read:
+ case QUEUE_FOR_NET_READ:
/* READ or READA, and
* no local disk,
* or target area marked as invalid,
@@ -486,7 +486,7 @@ int __req_mod(struct drbd_request *req, enum drbd_req_event what,
drbd_queue_work(&mdev->data.work, &req->w);
break;
- case queue_for_net_write:
+ case QUEUE_FOR_NET_WRITE:
/* assert something? */
/* from drbd_make_request_common only */
@@ -533,17 +533,17 @@ int __req_mod(struct drbd_request *req, enum drbd_req_event what,
break;
- case queue_for_send_oos:
+ case QUEUE_FOR_SEND_OOS:
req->rq_state |= RQ_NET_QUEUED;
req->w.cb = w_send_oos;
drbd_queue_work(&mdev->data.work, &req->w);
break;
- case oos_handed_to_network:
+ case OOS_HANDED_TO_NETWORK:
/* actually the same */
- case send_canceled:
+ case SEND_CANCELED:
/* treat it the same */
- case send_failed:
+ case SEND_FAILED:
/* real cleanup will be done from tl_clear. just update flags
* so it is no longer marked as on the worker queue */
req->rq_state &= ~RQ_NET_QUEUED;
@@ -552,7 +552,7 @@ int __req_mod(struct drbd_request *req, enum drbd_req_event what,
_req_may_be_done_not_susp(req, m);
break;
- case handed_over_to_network:
+ case HANDED_OVER_TO_NETWORK:
/* assert something? */
if (bio_data_dir(req->master_bio) == WRITE)
atomic_add(req->i.size >> 9, &mdev->ap_in_flight);
@@ -573,17 +573,17 @@ int __req_mod(struct drbd_request *req, enum drbd_req_event what,
req->rq_state &= ~RQ_NET_QUEUED;
req->rq_state |= RQ_NET_SENT;
/* because _drbd_send_zc_bio could sleep, and may want to
- * dereference the bio even after the "write_acked_by_peer" and
- * "completed_ok" events came in, once we return from
+ * dereference the bio even after the "WRITE_ACKED_BY_PEER" and
+ * "COMPLETED_OK" events came in, once we return from
* _drbd_send_zc_bio (drbd_send_dblock), we have to check
* whether it is done already, and end it. */
_req_may_be_done_not_susp(req, m);
break;
- case read_retry_remote_canceled:
+ case READ_RETRY_REMOTE_CANCELED:
req->rq_state &= ~RQ_NET_QUEUED;
/* fall through, in case we raced with drbd_disconnect */
- case connection_lost_while_pending:
+ case CONNECTION_LOST_WHILE_PENDING:
/* transfer log cleanup after connection loss */
/* assert something? */
if (req->rq_state & RQ_NET_PENDING)
@@ -599,19 +599,19 @@ int __req_mod(struct drbd_request *req, enum drbd_req_event what,
_req_may_be_done(req, m); /* Allowed while state.susp */
break;
- case write_acked_by_peer_and_sis:
+ case WRITE_ACKED_BY_PEER_AND_SIS:
req->rq_state |= RQ_NET_SIS;
- case conflict_discarded_by_peer:
+ case CONFLICT_DISCARDED_BY_PEER:
/* for discarded conflicting writes of multiple primaries,
* there is no need to keep anything in the tl, potential
* node crashes are covered by the activity log. */
- if (what == conflict_discarded_by_peer)
+ if (what == CONFLICT_DISCARDED_BY_PEER)
dev_alert(DEV, "Got DiscardAck packet %llus +%u!"
" DRBD is not a random data generator!\n",
(unsigned long long)req->i.sector, req->i.size);
req->rq_state |= RQ_NET_DONE;
/* fall through */
- case write_acked_by_peer:
+ case WRITE_ACKED_BY_PEER:
/* protocol C; successfully written on peer.
* Nothing to do here.
* We want to keep the tl in place for all protocols, to cater
@@ -623,9 +623,9 @@ int __req_mod(struct drbd_request *req, enum drbd_req_event what,
* P_BARRIER_ACK, but that is an unnecessary optimization. */
/* this makes it effectively the same as for: */
- case recv_acked_by_peer:
+ case RECV_ACKED_BY_PEER:
/* protocol B; pretends to be successfully written on peer.
- * see also notes above in handed_over_to_network about
+ * see also notes above in HANDED_OVER_TO_NETWORK about
* protocol != C */
req->rq_state |= RQ_NET_OK;
D_ASSERT(req->rq_state & RQ_NET_PENDING);
@@ -635,7 +635,7 @@ int __req_mod(struct drbd_request *req, enum drbd_req_event what,
_req_may_be_done_not_susp(req, m);
break;
- case neg_acked:
+ case NEG_ACKED:
/* assert something? */
if (req->rq_state & RQ_NET_PENDING) {
dec_ap_pending(mdev);
@@ -645,17 +645,17 @@ int __req_mod(struct drbd_request *req, enum drbd_req_event what,
req->rq_state |= RQ_NET_DONE;
_req_may_be_done_not_susp(req, m);
- /* else: done by handed_over_to_network */
+ /* else: done by HANDED_OVER_TO_NETWORK */
break;
- case fail_frozen_disk_io:
+ case FAIL_FROZEN_DISK_IO:
if (!(req->rq_state & RQ_LOCAL_COMPLETED))
break;
_req_may_be_done(req, m); /* Allowed while state.susp */
break;
- case restart_frozen_disk_io:
+ case RESTART_FROZEN_DISK_IO:
if (!(req->rq_state & RQ_LOCAL_COMPLETED))
break;
@@ -670,7 +670,7 @@ int __req_mod(struct drbd_request *req, enum drbd_req_event what,
drbd_queue_work(&mdev->data.work, &req->w);
break;
- case resend:
+ case RESEND:
/* If RQ_NET_OK is already set, we got a P_WRITE_ACK or P_RECV_ACK
before the connection loss (B&C only); only P_BARRIER_ACK was missing.
Trowing them out of the TL here by pretending we got a BARRIER_ACK
@@ -682,9 +682,9 @@ int __req_mod(struct drbd_request *req, enum drbd_req_event what,
}
break;
}
- /* else, fall through to barrier_acked */
+ /* else, fall through to BARRIER_ACKED */
- case barrier_acked:
+ case BARRIER_ACKED:
if (!(req->rq_state & RQ_WRITE))
break;
@@ -692,7 +692,7 @@ int __req_mod(struct drbd_request *req, enum drbd_req_event what,
/* barrier came in before all requests have been acked.
* this is bad, because if the connection is lost now,
* we won't be able to clean them up... */
- dev_err(DEV, "FIXME (barrier_acked but pending)\n");
+ dev_err(DEV, "FIXME (BARRIER_ACKED but pending)\n");
list_move(&req->tl_requests, &mdev->out_of_sequence_requests);
}
if ((req->rq_state & RQ_NET_MASK) != 0) {
@@ -703,7 +703,7 @@ int __req_mod(struct drbd_request *req, enum drbd_req_event what,
_req_may_be_done(req, m); /* Allowed while state.susp */
break;
- case data_received:
+ case DATA_RECEIVED:
D_ASSERT(req->rq_state & RQ_NET_PENDING);
dec_ap_pending(mdev);
req->rq_state &= ~RQ_NET_PENDING;
@@ -924,9 +924,9 @@ allocate_barrier:
/* mark them early for readability.
* this just sets some state flags. */
if (remote)
- _req_mod(req, to_be_send);
+ _req_mod(req, TO_BE_SENT);
if (local)
- _req_mod(req, to_be_submitted);
+ _req_mod(req, TO_BE_SUBMITTED);
/* check this request on the collision detection hash tables.
* if we have a conflict, just complete it here.
@@ -944,11 +944,11 @@ allocate_barrier:
* or READ, but not in sync.
*/
_req_mod(req, (rw == WRITE)
- ? queue_for_net_write
- : queue_for_net_read);
+ ? QUEUE_FOR_NET_WRITE
+ : QUEUE_FOR_NET_READ);
}
if (send_oos && drbd_set_out_of_sync(mdev, sector, size))
- _req_mod(req, queue_for_send_oos);
+ _req_mod(req, QUEUE_FOR_SEND_OOS);
if (remote &&
mdev->net_conf->on_congestion != OC_BLOCK && mdev->agreed_pro_version >= 96) {
diff --git a/drivers/block/drbd/drbd_req.h b/drivers/block/drbd/drbd_req.h
index ee59174..6dbbe89 100644
--- a/drivers/block/drbd/drbd_req.h
+++ b/drivers/block/drbd/drbd_req.h
@@ -77,39 +77,39 @@
*/
enum drbd_req_event {
- created,
- to_be_send,
- to_be_submitted,
+ CREATED,
+ TO_BE_SENT,
+ TO_BE_SUBMITTED,
/* XXX yes, now I am inconsistent...
* these are not "events" but "actions"
* oh, well... */
- queue_for_net_write,
- queue_for_net_read,
- queue_for_send_oos,
-
- send_canceled,
- send_failed,
- handed_over_to_network,
- oos_handed_to_network,
- connection_lost_while_pending,
- read_retry_remote_canceled,
- recv_acked_by_peer,
- write_acked_by_peer,
- write_acked_by_peer_and_sis, /* and set_in_sync */
- conflict_discarded_by_peer,
- neg_acked,
- barrier_acked, /* in protocol A and B */
- data_received, /* (remote read) */
-
- read_completed_with_error,
- read_ahead_completed_with_error,
- write_completed_with_error,
- completed_ok,
- resend,
- fail_frozen_disk_io,
- restart_frozen_disk_io,
- nothing, /* for tracing only */
+ QUEUE_FOR_NET_WRITE,
+ QUEUE_FOR_NET_READ,
+ QUEUE_FOR_SEND_OOS,
+
+ SEND_CANCELED,
+ SEND_FAILED,
+ HANDED_OVER_TO_NETWORK,
+ OOS_HANDED_TO_NETWORK,
+ CONNECTION_LOST_WHILE_PENDING,
+ READ_RETRY_REMOTE_CANCELED,
+ RECV_ACKED_BY_PEER,
+ WRITE_ACKED_BY_PEER,
+ WRITE_ACKED_BY_PEER_AND_SIS, /* and set_in_sync */
+ CONFLICT_DISCARDED_BY_PEER,
+ NEG_ACKED,
+ BARRIER_ACKED, /* in protocol A and B */
+ DATA_RECEIVED, /* (remote read) */
+
+ READ_COMPLETED_WITH_ERROR,
+ READ_AHEAD_COMPLETED_WITH_ERROR,
+ WRITE_COMPLETED_WITH_ERROR,
+ COMPLETED_OK,
+ RESEND,
+ FAIL_FROZEN_DISK_IO,
+ RESTART_FROZEN_DISK_IO,
+ NOTHING,
};
/* encoding of request states for now. we don't actually need that many bits.
@@ -138,8 +138,8 @@ enum drbd_req_state_bits {
* recv_ack (B) or implicit "ack" (A),
* still waiting for the barrier ack.
* master_bio may already be completed and invalidated.
- * 11100: write_acked (C),
- * data_received (for remote read, any protocol)
+ * 11100: write acked (C),
+ * data received (for remote read, any protocol)
* or finally the barrier ack has arrived (B,A)...
* request can be freed
* 01100: neg-acked (write, protocol C)
diff --git a/drivers/block/drbd/drbd_worker.c b/drivers/block/drbd/drbd_worker.c
index 1ddf6b6..550617b 100644
--- a/drivers/block/drbd/drbd_worker.c
+++ b/drivers/block/drbd/drbd_worker.c
@@ -209,12 +209,12 @@ void drbd_endio_pri(struct bio *bio, int error)
/* to avoid recursion in __req_mod */
if (unlikely(error)) {
what = (bio_data_dir(bio) == WRITE)
- ? write_completed_with_error
+ ? WRITE_COMPLETED_WITH_ERROR
: (bio_rw(bio) == READ)
- ? read_completed_with_error
- : read_ahead_completed_with_error;
+ ? READ_COMPLETED_WITH_ERROR
+ : READ_AHEAD_COMPLETED_WITH_ERROR;
} else
- what = completed_ok;
+ what = COMPLETED_OK;
bio_put(req->private_bio);
req->private_bio = ERR_PTR(error);
@@ -238,7 +238,7 @@ int w_read_retry_remote(struct drbd_conf *mdev, struct drbd_work *w, int cancel)
spin_lock_irq(&mdev->req_lock);
if (cancel || mdev->state.pdsk != D_UP_TO_DATE) {
- _req_mod(req, read_retry_remote_canceled);
+ _req_mod(req, READ_RETRY_REMOTE_CANCELED);
spin_unlock_irq(&mdev->req_lock);
return 1;
}
@@ -1243,12 +1243,12 @@ int w_send_oos(struct drbd_conf *mdev, struct drbd_work *w, int cancel)
int ok;
if (unlikely(cancel)) {
- req_mod(req, send_canceled);
+ req_mod(req, SEND_CANCELED);
return 1;
}
ok = drbd_send_oos(mdev, req);
- req_mod(req, oos_handed_to_network);
+ req_mod(req, OOS_HANDED_TO_NETWORK);
return ok;
}
@@ -1265,12 +1265,12 @@ int w_send_dblock(struct drbd_conf *mdev, struct drbd_work *w, int cancel)
int ok;
if (unlikely(cancel)) {
- req_mod(req, send_canceled);
+ req_mod(req, SEND_CANCELED);
return 1;
}
ok = drbd_send_dblock(mdev, req);
- req_mod(req, ok ? handed_over_to_network : send_failed);
+ req_mod(req, ok ? HANDED_OVER_TO_NETWORK : SEND_FAILED);
return ok;
}
@@ -1287,7 +1287,7 @@ int w_send_read_req(struct drbd_conf *mdev, struct drbd_work *w, int cancel)
int ok;
if (unlikely(cancel)) {
- req_mod(req, send_canceled);
+ req_mod(req, SEND_CANCELED);
return 1;
}
@@ -1300,7 +1300,7 @@ int w_send_read_req(struct drbd_conf *mdev, struct drbd_work *w, int cancel)
if (mdev->state.conn >= C_CONNECTED)
drbd_force_state(mdev, NS(conn, C_NETWORK_FAILURE));
}
- req_mod(req, ok ? handed_over_to_network : send_failed);
+ req_mod(req, ok ? HANDED_OVER_TO_NETWORK : SEND_FAILED);
return ok;
}
--
1.7.4.1
next prev parent reply other threads:[~2011-08-25 15:33 UTC|newest]
Thread overview: 132+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-25 15:06 [RFC 000/118] drbd: part 1 of adding multiple volume support to drbd Philipp Reisner
2011-08-25 15:06 ` [PATCH 001/118] drbd: Get rid of req_validator_fn typedef Philipp Reisner
2011-08-25 15:06 ` [PATCH 002/118] drbd: Remove superfluous declaration Philipp Reisner
2011-08-25 15:06 ` [PATCH 003/118] drbd: Consistently use block_id == ID_SYNCER for checksum based resync and online verify Philipp Reisner
2011-08-25 15:07 ` [PATCH 004/118] drbd: Get rid of BE_DRBD_MAGIC and BE_DRBD_MAGIC_BIG Philipp Reisner
2011-08-25 15:07 ` [PATCH 005/118] drbd: Endianness convert the constants instead of the variables Philipp Reisner
2011-08-25 15:07 ` [PATCH 006/118] drbd: Magic reserved block_id value cleanup Philipp Reisner
2011-08-25 15:07 ` [PATCH 007/118] drbd: Move drbd_free_tl_hash() to drbd_main() Philipp Reisner
2011-08-25 15:07 ` [PATCH 008/118] drbd: Update outdated comment Philipp Reisner
2011-08-25 15:07 ` [PATCH 009/118] drbd: Request lookup code cleanup (1) Philipp Reisner
2011-08-25 15:07 ` [PATCH 010/118] drbd: Request lookup code cleanup (2) Philipp Reisner
2011-08-25 15:07 ` [PATCH 011/118] drbd: Request lookup code cleanup (3) Philipp Reisner
2011-08-25 15:07 ` [PATCH 012/118] drbd: Request lookup code cleanup (4) Philipp Reisner
2011-08-25 15:07 ` [PATCH 013/118] drbd: Add interval tree data structure Philipp Reisner
2011-08-25 15:07 ` [PATCH 014/118] drbd: Put sector and size in struct drbd_request into struct drbd_interval Philipp Reisner
2011-08-25 15:07 ` [PATCH 015/118] drbd: Use interval tree for overlapping write request detection Philipp Reisner
2011-08-25 15:07 ` [PATCH 016/118] drbd: Add read_requests tree Philipp Reisner
2011-08-25 18:02 ` [Drbd-dev] " Pawel Jakub Dawidek
2011-08-29 11:42 ` Philipp Reisner
2011-08-25 15:07 ` [PATCH 017/118] drbd: Use the read and write request trees for request lookups Philipp Reisner
2011-08-25 15:07 ` [PATCH 018/118] drbd: Put sector and size in struct drbd_epoch_entry into struct drbd_interval Philipp Reisner
2011-08-25 15:07 ` [PATCH 019/118] drbd: Use interval tree for overlapping epoch entry detection Philipp Reisner
2011-08-25 15:07 ` [PATCH 020/118] drbd: Remove the unused hash tables Philipp Reisner
2011-08-25 15:07 ` Philipp Reisner [this message]
2011-08-25 15:07 ` [PATCH 022/118] drbd: Convert all constants in enum drbd_thread_state to upper case Philipp Reisner
2011-08-25 15:07 ` [PATCH 023/118] drbd: Replace the ERR_IF macro with an assert-like macro Philipp Reisner
2011-08-25 15:07 ` [PATCH 024/118] drbd: Remove some useless paranoia code Philipp Reisner
2011-08-25 15:07 ` [PATCH 025/118] drbd: Inline function overlaps() is now unused Philipp Reisner
2011-08-25 15:07 ` [PATCH 026/118] drbd: Interval tree bugfix Philipp Reisner
2011-08-25 15:07 ` [PATCH 027/118] idr: idr_for_each_entry() macro Philipp Reisner
2011-08-25 15:07 ` [PATCH 028/118] drbd: Minimal struct drbd_tconn Philipp Reisner
2011-08-25 15:07 ` [PATCH 029/118] drbd: moved net_conf from mdev to tconn Philipp Reisner
2011-08-25 15:07 ` [PATCH 030/118] drbd: moved net_cont and net_cnt_wait " Philipp Reisner
2011-08-25 15:07 ` [PATCH 031/118] drbd: moved data and meta " Philipp Reisner
2011-08-25 15:07 ` [PATCH 032/118] drbd: moved receiver, worker and asender " Philipp Reisner
2011-08-25 15:07 ` [PATCH 033/118] drbd: moved agreed_pro_version, last_received and ko_count " Philipp Reisner
2011-08-25 15:07 ` [PATCH 034/118] drbd: moved req_lock and transfer log from mdev " Philipp Reisner
2011-08-25 15:07 ` [PATCH 035/118] drbd: moved crypto transformations and friends " Philipp Reisner
2011-08-25 15:07 ` [PATCH 036/118] drbd: Made drbd_flush_workqueue() to take a tconn instead of an mdev Philipp Reisner
2011-08-25 15:07 ` [PATCH 037/118] drbd: Preparing to use p_header96 for all packets Philipp Reisner
2011-08-25 15:07 ` [PATCH 038/118] drbd: Replaced all p_header80 with a generic p_header Philipp Reisner
2011-08-25 15:07 ` [PATCH 039/118] drbd: Use new header layout, and send volume IOs Philipp Reisner
2011-08-25 15:07 ` [PATCH 040/118] drbd: Implemented receiving of new style packets on meta socket Philipp Reisner
2011-08-25 15:07 ` [PATCH 041/118] drbd: Do not access tconn after it was freed Philipp Reisner
2011-08-25 15:07 ` [PATCH 042/118] drbd: Move cmdname() out of drbd_int.h Philipp Reisner
2011-08-25 15:07 ` [PATCH 043/118] drbd: Rename "enum drbd_packets" to "enum drbd_packet" Philipp Reisner
2011-08-25 15:07 ` [PATCH 044/118] drbd: Remove redundant initialization Philipp Reisner
2011-08-25 15:07 ` [PATCH 045/118] drbd: Initialize the sequence number sent over the network even when not used Philipp Reisner
2011-08-25 15:07 ` [PATCH 046/118] drbd: Move sequence number logic into drbd_receiver.c and simplify it Philipp Reisner
2011-08-25 15:07 ` [PATCH 047/118] drbd: Move some functions to where they are used Philipp Reisner
2011-08-25 15:07 ` [PATCH 048/118] drbd: struct drbd_request: Introduce a new collision flag Philipp Reisner
2011-08-25 15:07 ` [PATCH 049/118] drbd: Remove redundant check from drbd_contains_interval() Philipp Reisner
2011-08-25 15:07 ` [PATCH 050/118] drbd: Allow to wait for the completion of an epoch entry as well Philipp Reisner
2011-08-25 15:07 ` [PATCH 051/118] drbd: _req_conflicts(): Get rid of the epoch_entries tree Philipp Reisner
2011-08-25 15:07 ` [PATCH 052/118] drbd: Remove unnecessary reference counting left-over Philipp Reisner
2011-08-25 15:07 ` [PATCH 053/118] drbd: Defer new writes when detecting conflicting writes Philipp Reisner
2011-08-25 15:07 ` [PATCH 054/118] drbd: Make the peer_seq updating code more obvious Philipp Reisner
2011-08-25 15:07 ` [PATCH 055/118] drbd: Improve the drbd_find_overlap() documentation Philipp Reisner
2011-08-25 15:07 ` [PATCH 056/118] drbd: Remove unused variable in struct drbd_conf Philipp Reisner
2011-08-25 15:07 ` [PATCH 057/118] drbd: Rename struct drbd_epoch_entry to struct drbd_peer_request Philipp Reisner
2011-08-25 15:07 ` [PATCH 058/118] drbd: Clean up some left-overs Philipp Reisner
2011-08-25 15:07 ` [PATCH 059/118] drbd: Update some comments Philipp Reisner
2011-08-25 15:07 ` [PATCH 060/118] drbd: Local variable renames: e -> peer_req Philipp Reisner
2011-08-25 15:07 ` [PATCH 061/118] drbd: Moved the state functions into its own source file Philipp Reisner
2011-08-25 15:07 ` [PATCH 062/118] drbd: Moved the thread name into the data structure Philipp Reisner
2011-08-25 15:07 ` [PATCH 063/118] drbd: Eliminated the user of drbd_task_to_thread() Philipp Reisner
2011-08-25 15:08 ` [PATCH 064/118] drbd: Moved code Philipp Reisner
2011-08-25 15:08 ` [PATCH 065/118] drbd: Do no sleep long in drbd_start_resync Philipp Reisner
2011-08-25 15:08 ` [PATCH 066/118] drbd: Revert "Make sure we dont send state if a cluster wide state change is in progress" Philipp Reisner
2011-08-25 15:08 ` [PATCH 067/118] drbd: Moving state related macros to drbd_state.h Philipp Reisner
2011-08-25 15:08 ` [PATCH 068/118] drbd: conn_printk() a dev_printk() alike for drbd's connections Philipp Reisner
2011-08-25 18:16 ` Joe Perches
2011-08-29 11:42 ` [Drbd-dev] " Philipp Reisner
2011-08-25 15:08 ` [PATCH 069/118] drbd: Converted drbd_try_connect() from mdev to tconn Philipp Reisner
2011-08-25 15:08 ` [PATCH 070/118] drbd: Converted drbd_wait_for_connect() " Philipp Reisner
2011-08-25 15:08 ` [PATCH 071/118] drbd: Started to separated connection flags (tconn) from block device flags (mdev) Philipp Reisner
2011-08-25 15:08 ` [PATCH 072/118] drbd: Moved DISCARD_CONCURRENT to the per connection (tconn) flags Philipp Reisner
2011-08-25 15:08 ` [PATCH 073/118] drbd: Moved SEND_PING " Philipp Reisner
2011-08-25 15:08 ` [PATCH 074/118] drbd: Moved SIGNAL_ASENDER " Philipp Reisner
2011-08-25 15:08 ` [PATCH 075/118] drbd: Converted wake_asender() and request_ping() from mdev to tconn Philipp Reisner
2011-08-25 15:08 ` [PATCH 076/118] drbd: Converted helper functions for drbd_send() " Philipp Reisner
2011-08-25 15:08 ` [PATCH 077/118] drbd: Converted drbd_send() from mdev " Philipp Reisner
2011-08-25 15:08 ` [PATCH 078/118] drbd: Converted drbd_send_fp() " Philipp Reisner
2011-08-25 15:08 ` [PATCH 079/118] drbd: Removed unused mdev argument from drbd_recv_short() and drbd_socket_okay() Philipp Reisner
2011-08-25 15:08 ` [PATCH 080/118] drbd: Converted drbd_recv_fp() from mdev to tconn Philipp Reisner
2011-08-25 15:08 ` [PATCH 081/118] drbd: Converted drbd_send_handshake() " Philipp Reisner
2011-08-25 15:08 ` [PATCH 082/118] drbd: Converted drbd_recv() " Philipp Reisner
2011-08-25 15:08 ` [PATCH 083/118] drbd: struct packet_info to hold information of decoded packets Philipp Reisner
2011-08-25 15:08 ` [PATCH 084/118] drbd: Converted decode_header() from mdev to tconn Philipp Reisner
2011-08-25 15:08 ` [PATCH 085/118] drbd: Converted drbd_recv_header() " Philipp Reisner
2011-08-25 15:08 ` [PATCH 086/118] drbd: Converted drbd_do_handshake() " Philipp Reisner
2011-08-25 15:08 ` [PATCH 087/118] drbd: Converted drbd_(get|put)_data_sock() and drbd_send_cmd2() " Philipp Reisner
2011-08-25 15:08 ` [PATCH 088/118] drbd: Converted drbd_do_auth() from mdev " Philipp Reisner
2011-08-25 15:08 ` [PATCH 089/118] drbd: Converted drbd_send_protocol() " Philipp Reisner
2011-08-25 15:08 ` [PATCH 090/118] drbd: Use and idr data structure to map volume numbers to mdev pointers Philipp Reisner
2011-08-25 15:08 ` [PATCH 091/118] drbd: Converted drbd_connect() from mdev to tconn Philipp Reisner
2011-08-25 15:08 ` [PATCH 092/118] drbd: Converted drbd_calc_cpu_mask() and drbd_thread_current_set_cpu() " Philipp Reisner
2011-08-25 15:08 ` [PATCH 093/118] drbd: Converted drbdd() " Philipp Reisner
2011-08-25 15:08 ` [PATCH 094/118] drbd: Converted drbd_free_sock() and drbd_disconnect() " Philipp Reisner
2011-08-25 15:08 ` [PATCH 095/118] drbd: Moved the mdev member into drbd_work (from drbd_request and drbd_peer_request) Philipp Reisner
2011-08-25 15:08 ` [PATCH 096/118] drbd: Consolidated the setup of the thread name into the framework Philipp Reisner
2011-08-25 15:08 ` [PATCH 097/118] drbd: Converted drbdd_init() from mdev to tconn Philipp Reisner
2011-08-25 15:08 ` [PATCH 098/118] drbd: Converted drbd_asender() " Philipp Reisner
2011-08-25 15:08 ` [PATCH 099/118] drbd: Converted drbd_worker() " Philipp Reisner
2011-08-25 15:08 ` [PATCH 100/118] drbd: drbd_thread has now a pointer to a tconn instead of to a mdev Philipp Reisner
2011-08-25 15:08 ` [PATCH 101/118] drbd: Moved some initializing code into drbd_new_tconn() Philipp Reisner
2011-08-25 15:08 ` [PATCH 102/118] drbd: Generalized the work callbacks Philipp Reisner
2011-08-25 15:08 ` [PATCH 103/118] drbd: Converted drbd_send_ping() and related functions from mdev to tconn Philipp Reisner
2011-08-25 15:08 ` [PATCH 104/118] drbd: Extracted after_conn_state_ch() out of after_state_ch() Philipp Reisner
2011-08-25 15:08 ` [PATCH 105/118] drbd: Renamed is_valid_state_transition() to is_valid_soft_transition() Philipp Reisner
2011-08-25 15:08 ` [PATCH 106/118] drbd: Extracted is_valid_transition() out of sanitize_state() Philipp Reisner
2011-08-25 15:08 ` [PATCH 107/118] drbd: Extracted is_valid_conn_transition() out of is_valid_transition() Philipp Reisner
2011-08-25 15:08 ` [PATCH 108/118] drbd: Removed the os parameter form sanitize_state() Philipp Reisner
2011-08-25 15:08 ` [PATCH 109/118] drbd: Code de-duplication; new function apply_mask_val() Philipp Reisner
2011-08-25 15:08 ` [PATCH 110/118] drbd: Killed volume0; last step of multi-volume-enablement Philipp Reisner
2011-08-25 15:08 ` [PATCH 111/118] drbd: Removed drbd_state_lock() and drbd_state_unlock() Philipp Reisner
2011-08-25 15:08 ` [PATCH 112/118] drbd: Introduced tconn->cstate_mutex Philipp Reisner
2011-08-25 15:08 ` [PATCH 113/118] drbd: Implemented conn_send_state_req() Philipp Reisner
2011-08-25 15:08 ` [PATCH 114/118] drbd: Global_state_lock not necessary here Philipp Reisner
2011-08-25 15:08 ` [PATCH 115/118] drbd: Implemented conn_send_sr_reply() Philipp Reisner
2011-08-25 15:08 ` [PATCH 116/118] drbd: Implemented receiving of P_CONN_ST_CHG_REPLY Philipp Reisner
2011-08-25 15:08 ` [PATCH 117/118] drbd: implemented receiving of P_CONN_ST_CHG_REQ Philipp Reisner
2011-08-25 15:08 ` [PATCH 118/118] drbd: Implemented connection wide state changes Philipp Reisner
2011-08-26 1:30 ` [RFC 000/118] drbd: part 1 of adding multiple volume support to drbd David Miller
[not found] ` <CAGpXXZKem-uEdF4SyUgpQFV6=d5Vo3v9p3wmcaygAKa4w4x01w@mail.gmail.com>
2011-08-26 13:54 ` [Drbd-dev] " Lars Ellenberg
2011-08-26 15:18 ` Kyle Moffett
2011-08-29 11:51 ` Philipp Reisner
2011-08-29 12:52 ` Pekka Enberg
2011-08-29 15:38 ` Philipp Reisner
2011-08-29 11:46 ` Philipp Reisner
2011-08-29 13:26 ` Greg Freemyer
2011-08-29 16:07 ` Philipp Reisner
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=1314284934-17999-22-git-send-email-philipp.reisner@linbit.com \
--to=philipp.reisner@linbit.com \
--cc=axboe@kernel.dk \
--cc=drbd-dev@lists.linbit.com \
--cc=linux-kernel@vger.kernel.org \
/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
all inboxes | Powered by JetHome®