Commit 4669265a authored by Philipp Reisner's avatar Philipp Reisner

drbd: Implemented conn_lowest_disk()

Signed-off-by: default avatarPhilipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: default avatarLars Ellenberg <lars.ellenberg@linbit.com>
parent 19f83c76
...@@ -121,6 +121,18 @@ enum drbd_disk_state conn_highest_disk(struct drbd_tconn *tconn) ...@@ -121,6 +121,18 @@ enum drbd_disk_state conn_highest_disk(struct drbd_tconn *tconn)
return ds; return ds;
} }
enum drbd_disk_state conn_lowest_disk(struct drbd_tconn *tconn)
{
enum drbd_disk_state ds = D_MASK;
struct drbd_conf *mdev;
int vnr;
idr_for_each_entry(&tconn->volumes, mdev, vnr)
ds = min_t(enum drbd_disk_state, ds, mdev->state.disk);
return ds;
}
enum drbd_disk_state conn_highest_pdsk(struct drbd_tconn *tconn) enum drbd_disk_state conn_highest_pdsk(struct drbd_tconn *tconn)
{ {
enum drbd_disk_state ds = D_DISKLESS; enum drbd_disk_state ds = D_DISKLESS;
......
...@@ -153,6 +153,7 @@ static inline int drbd_request_state(struct drbd_conf *mdev, ...@@ -153,6 +153,7 @@ static inline int drbd_request_state(struct drbd_conf *mdev,
enum drbd_role conn_highest_role(struct drbd_tconn *tconn); enum drbd_role conn_highest_role(struct drbd_tconn *tconn);
enum drbd_role conn_highest_peer(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_disk(struct drbd_tconn *tconn);
enum drbd_disk_state conn_lowest_disk(struct drbd_tconn *tconn);
enum drbd_disk_state conn_highest_pdsk(struct drbd_tconn *tconn); enum drbd_disk_state conn_highest_pdsk(struct drbd_tconn *tconn);
enum drbd_conns conn_lowest_conn(struct drbd_tconn *tconn); enum drbd_conns conn_lowest_conn(struct drbd_tconn *tconn);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment