diff options
author | Philipp Reisner <philipp.reisner@linbit.com> | 2011-03-29 12:21:03 (GMT) |
---|---|---|
committer | Philipp Reisner <philipp.reisner@linbit.com> | 2012-11-08 15:45:05 (GMT) |
commit | 19f83c76616a0c2112943b5af65483e16a1986da (patch) | |
tree | be91728f260bfdb60a9b2d7baf4b4d1e39080742 /drivers/block/drbd | |
parent | 8c7e16c39ffe77438906ff9d6196a80d171e9e32 (diff) | |
download | linux-fsl-qoriq-19f83c76616a0c2112943b5af65483e16a1986da.tar.xz |
drbd: Implemented conn_lowest_conn()
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
Diffstat (limited to 'drivers/block/drbd')
-rw-r--r-- | drivers/block/drbd/drbd_nl.c | 2 | ||||
-rw-r--r-- | drivers/block/drbd/drbd_state.c | 12 | ||||
-rw-r--r-- | drivers/block/drbd/drbd_state.h | 1 |
3 files changed, 14 insertions, 1 deletions
diff --git a/drivers/block/drbd/drbd_nl.c b/drivers/block/drbd/drbd_nl.c index ed08dce..5cf1164 100644 --- a/drivers/block/drbd/drbd_nl.c +++ b/drivers/block/drbd/drbd_nl.c @@ -1590,7 +1590,7 @@ int drbd_adm_attach(struct sk_buff *skb, struct genl_info *info) static int adm_detach(struct drbd_conf *mdev) { - enum drbd_ret_code retcode; + enum drbd_state_rv retcode; drbd_suspend_io(mdev); /* so no-one is stuck in drbd_al_begin_io */ retcode = drbd_request_state(mdev, NS(disk, D_DISKLESS)); wait_event(mdev->misc_wait, diff --git a/drivers/block/drbd/drbd_state.c b/drivers/block/drbd/drbd_state.c index 0ce6653..36703fe 100644 --- a/drivers/block/drbd/drbd_state.c +++ b/drivers/block/drbd/drbd_state.c @@ -133,6 +133,18 @@ enum drbd_disk_state conn_highest_pdsk(struct drbd_tconn *tconn) return ds; } +enum drbd_conns 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..286af06 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_conns conn_lowest_conn(struct drbd_tconn *tconn); #endif |