diff options
author | Philipp Reisner <philipp.reisner@linbit.com> | 2010-10-27 06:21:30 -0400 |
---|---|---|
committer | Philipp Reisner <philipp.reisner@linbit.com> | 2011-03-10 05:34:46 -0500 |
commit | 67531718d8f1259f01ab84c2aa25f7b03c7afd46 (patch) | |
tree | 6f76323440f8ce3793b5d5f1a19808207f38db5b /drivers/block/drbd/drbd_req.c | |
parent | 422028b1ca4c07995af82a18abced022ff4c296c (diff) |
drbd: Implemented two new connection states Ahead/Behind
In this connection mode, the ahead node no longer replicates
application IO. The behind's disk becomes out dated.
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
Diffstat (limited to 'drivers/block/drbd/drbd_req.c')
-rw-r--r-- | drivers/block/drbd/drbd_req.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/drivers/block/drbd/drbd_req.c b/drivers/block/drbd/drbd_req.c index 5c60d77d447c..60288fb3c4d7 100644 --- a/drivers/block/drbd/drbd_req.c +++ b/drivers/block/drbd/drbd_req.c | |||
@@ -948,6 +948,29 @@ allocate_barrier: | |||
948 | ? queue_for_net_write | 948 | ? queue_for_net_write |
949 | : queue_for_net_read); | 949 | : queue_for_net_read); |
950 | } | 950 | } |
951 | |||
952 | if (remote && mdev->net_conf->on_congestion != OC_BLOCK) { | ||
953 | int congested = 0; | ||
954 | |||
955 | if (mdev->net_conf->cong_fill && | ||
956 | atomic_read(&mdev->ap_in_flight) >= mdev->net_conf->cong_fill) { | ||
957 | dev_info(DEV, "Congestion-fill threshold reached\n"); | ||
958 | congested = 1; | ||
959 | } | ||
960 | |||
961 | if (mdev->act_log->used >= mdev->net_conf->cong_extents) { | ||
962 | dev_info(DEV, "Congestion-extents threshold reached\n"); | ||
963 | congested = 1; | ||
964 | } | ||
965 | |||
966 | if (congested) { | ||
967 | if (mdev->net_conf->on_congestion == OC_PULL_AHEAD) | ||
968 | _drbd_set_state(_NS(mdev, conn, C_AHEAD), 0, NULL); | ||
969 | else /*mdev->net_conf->on_congestion == OC_DISCONNECT */ | ||
970 | _drbd_set_state(_NS(mdev, conn, C_DISCONNECTING), 0, NULL); | ||
971 | } | ||
972 | } | ||
973 | |||
951 | spin_unlock_irq(&mdev->req_lock); | 974 | spin_unlock_irq(&mdev->req_lock); |
952 | kfree(b); /* if someone else has beaten us to it... */ | 975 | kfree(b); /* if someone else has beaten us to it... */ |
953 | 976 | ||