mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
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 07/11] drbd: Implemented conn_lowest_conn()
Date: Fri,  9 Sep 2011 13:17:32 +0200	[thread overview]
Message-ID: <1315567056-32314-8-git-send-email-philipp.reisner@linbit.com> (raw)
In-Reply-To: <1315567056-32314-1-git-send-email-philipp.reisner@linbit.com>

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
---
 drivers/block/drbd/drbd_state.c |   12 ++++++++++++
 drivers/block/drbd/drbd_state.h |    1 +
 2 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/drivers/block/drbd/drbd_state.c b/drivers/block/drbd/drbd_state.c
index cfd923e..e441d1f 100644
--- a/drivers/block/drbd/drbd_state.c
+++ b/drivers/block/drbd/drbd_state.c
@@ -115,6 +115,18 @@ enum drbd_disk_state conn_highest_pdsk(struct drbd_tconn *tconn)
 	return ds;
 }
 
+enum drbd_disk_state conn_lowest_conn(struct drbd_tconn *tconn)
+{
+	enum drbd_conns conn = C_MASK;
+	struct drbd_conf *mdev;
+	int vnr;
+
+	idr_for_each_entry(&tconn->volumes, mdev, vnr)
+		conn = min_t(enum drbd_conns, conn, mdev->state.conn);
+
+	return conn;
+}
+
 /**
  * cl_wide_st_chg() - true if the state change is a cluster wide one
  * @mdev:	DRBD device.
diff --git a/drivers/block/drbd/drbd_state.h b/drivers/block/drbd/drbd_state.h
index 0f8441d..e554537 100644
--- a/drivers/block/drbd/drbd_state.h
+++ b/drivers/block/drbd/drbd_state.h
@@ -154,5 +154,6 @@ enum drbd_role conn_highest_role(struct drbd_tconn *tconn);
 enum drbd_role conn_highest_peer(struct drbd_tconn *tconn);
 enum drbd_disk_state conn_highest_disk(struct drbd_tconn *tconn);
 enum drbd_disk_state conn_highest_pdsk(struct drbd_tconn *tconn);
+enum drbd_disk_state conn_lowest_conn(struct drbd_tconn *tconn);
 
 #endif
-- 
1.7.4.1


  parent reply	other threads:[~2011-09-09 11:17 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-09 11:17 [RFC 00/11] drbd: part 9 of adding multiple volume support to drbd Philipp Reisner
2011-09-09 11:17 ` [PATCH 01/11] drbd: Introduced drbd_read_state() Philipp Reisner
2011-09-09 11:17 ` [PATCH 02/11] drbd: Renamed id_susp(union drbd_state s) to drbd_suspended(struct drbd_conf *) Philipp Reisner
2011-09-09 11:17 ` [PATCH 03/11] drbd: Moved susp, susp_nod and susp_fen to the connection object Philipp Reisner
2011-09-09 11:17 ` [PATCH 04/11] drbd: Introduced a new type union drbd_dev_state Philipp Reisner
2011-09-09 11:17 ` [PATCH 05/11] drbd: Renamed nms to ns_max Philipp Reisner
2011-09-09 11:17 ` [PATCH 06/11] drbd: Calculate and provide ns_min to the w_after_conn_state_ch() work Philipp Reisner
2011-09-09 11:17 ` Philipp Reisner [this message]
2011-09-09 11:17 ` [PATCH 08/11] drbd: Implemented conn_lowest_disk() Philipp Reisner
2011-09-09 11:17 ` [PATCH 09/11] drbd: Implemented IO thawing for multiple volumes Philipp Reisner
2011-09-09 11:17 ` [PATCH 10/11] drbd: Improved logging of state changes Philipp Reisner
2011-09-09 11:17 ` [PATCH 11/11] drbd: Use tconn in request_timer_fn() 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=1315567056-32314-8-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®