aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/drbd/drbd_worker.c
diff options
context:
space:
mode:
authorPhilipp Reisner <philipp.reisner@linbit.com>2010-05-31 04:14:17 -0400
committerPhilipp Reisner <philipp.reisner@linbit.com>2010-10-14 08:52:53 -0400
commit265be2d09853d425ad14a61cda0ca63345613d0c (patch)
treecc2f419d8aaa41fd088f3d24ca134c4d7f51aa64 /drivers/block/drbd/drbd_worker.c
parent905cd7d8ac9b18e1f122b90dbebe1246b1c364fd (diff)
drbd: Finished the "on-no-data-accessible suspend-io;" functionality
When no data is accessible (no connection to the peer, nor a local disk) allow the user to select to freeze all IO operations instead of getting IO errors. 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_worker.c')
-rw-r--r--drivers/block/drbd/drbd_worker.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/block/drbd/drbd_worker.c b/drivers/block/drbd/drbd_worker.c
index ca4a16cea2d8..3c1e88480d37 100644
--- a/drivers/block/drbd/drbd_worker.c
+++ b/drivers/block/drbd/drbd_worker.c
@@ -1173,6 +1173,24 @@ int w_send_read_req(struct drbd_conf *mdev, struct drbd_work *w, int cancel)
1173 return ok; 1173 return ok;
1174} 1174}
1175 1175
1176int w_restart_disk_io(struct drbd_conf *mdev, struct drbd_work *w, int cancel)
1177{
1178 struct drbd_request *req = container_of(w, struct drbd_request, w);
1179
1180 if (bio_data_dir(req->master_bio) == WRITE)
1181 drbd_al_begin_io(mdev, req->sector);
1182 /* Calling drbd_al_begin_io() out of the worker might deadlocks
1183 theoretically. Practically it can not deadlock, since this is
1184 only used when unfreezing IOs. All the extents of the requests
1185 that made it into the TL are already active */
1186
1187 drbd_req_make_private_bio(req, req->master_bio);
1188 req->private_bio->bi_bdev = mdev->ldev->backing_bdev;
1189 generic_make_request(req->private_bio);
1190
1191 return 1;
1192}
1193
1176static int _drbd_may_sync_now(struct drbd_conf *mdev) 1194static int _drbd_may_sync_now(struct drbd_conf *mdev)
1177{ 1195{
1178 struct drbd_conf *odev = mdev; 1196 struct drbd_conf *odev = mdev;