diff --git a/drivers/block/drbd/drbd_state.c b/drivers/block/drbd/drbd_state.c index a280bc238acdb9e3fae9005245a7836587813855..c27d3778cae644a71ab03ca564055fbf0b3b20ab 100644 --- a/drivers/block/drbd/drbd_state.c +++ b/drivers/block/drbd/drbd_state.c @@ -47,20 +47,18 @@ static enum drbd_state_rv is_valid_transition(union drbd_state os, union drbd_st static union drbd_state sanitize_state(struct drbd_conf *mdev, union drbd_state ns, const char **warn_sync_abort); -int conn_all_vols_unconf(struct drbd_tconn *tconn) +bool conn_all_vols_unconf(struct drbd_tconn *tconn) { struct drbd_conf *mdev; - int minor, uncfg = 1; + int minor; idr_for_each_entry(&tconn->volumes, mdev, minor) { - uncfg &= (mdev->state.disk == D_DISKLESS && - mdev->state.conn == C_STANDALONE && - mdev->state.role == R_SECONDARY); - if (!uncfg) - break; + if (mdev->state.disk != D_DISKLESS || + mdev->state.conn != C_STANDALONE || + mdev->state.role != R_SECONDARY) + return false; } - - return uncfg; + return true; } /** diff --git a/drivers/block/drbd/drbd_state.h b/drivers/block/drbd/drbd_state.h index d9536cd798e53b27c3d21dface69b71f24de5de5..55df0728bc88db5948a46295072958e5be928e5d 100644 --- a/drivers/block/drbd/drbd_state.h +++ b/drivers/block/drbd/drbd_state.h @@ -91,7 +91,7 @@ conn_request_state(struct drbd_tconn *tconn, union drbd_state mask, union drbd_s enum chg_state_flags flags); extern void drbd_resume_al(struct drbd_conf *mdev); -extern int conn_all_vols_unconf(struct drbd_tconn *tconn); +extern bool conn_all_vols_unconf(struct drbd_tconn *tconn); /** * drbd_request_state() - Reqest a state change