diff options
author | Philipp Reisner <philipp.reisner@linbit.com> | 2011-03-29 16:15:49 (GMT) |
---|---|---|
committer | Philipp Reisner <philipp.reisner@linbit.com> | 2012-11-08 15:45:05 (GMT) |
commit | 4669265a7bb146ae072951e26c8527fdc733eff6 (patch) | |
tree | daf3a6710ec4f7b3adc83d1f9c01fa6b917b51dd | |
parent | 19f83c76616a0c2112943b5af65483e16a1986da (diff) | |
download | linux-fsl-qoriq-4669265a7bb146ae072951e26c8527fdc733eff6.tar.xz |
drbd: Implemented conn_lowest_disk()
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
-rw-r--r-- | drivers/block/drbd/drbd_state.c | 12 | ||||
-rw-r--r-- | 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 36703fe..896d5dc 100644 --- a/drivers/block/drbd/drbd_state.c +++ b/drivers/block/drbd/drbd_state.c @@ -121,6 +121,18 @@ enum drbd_disk_state conn_highest_disk(struct drbd_tconn *tconn) 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 ds = D_DISKLESS; diff --git a/drivers/block/drbd/drbd_state.h b/drivers/block/drbd/drbd_state.h index 286af06..757f9d9 100644 --- a/drivers/block/drbd/drbd_state.h +++ b/drivers/block/drbd/drbd_state.h @@ -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_peer(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_conns conn_lowest_conn(struct drbd_tconn *tconn); |