aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/drbd/drbd_req.h
diff options
context:
space:
mode:
authorPhilipp Reisner <philipp.reisner@linbit.com>2010-10-26 10:02:27 -0400
committerPhilipp Reisner <philipp.reisner@linbit.com>2011-03-10 05:34:43 -0500
commit759fbdfba66e620aceb3e73167e6003d1b8b0b0b (patch)
tree34080a67cfdee2c0a2000126622bf65d4a7e0936 /drivers/block/drbd/drbd_req.h
parent688593c5a82068aea64df0b836793dfbbaa646d7 (diff)
drbd: Track the numbers of sectors in flight
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.h')
-rw-r--r--drivers/block/drbd/drbd_req.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/block/drbd/drbd_req.h b/drivers/block/drbd/drbd_req.h
index ab2bd09d54b4..69d350fe7c1e 100644
--- a/drivers/block/drbd/drbd_req.h
+++ b/drivers/block/drbd/drbd_req.h
@@ -338,19 +338,21 @@ static inline int _req_mod(struct drbd_request *req, enum drbd_req_event what)
338 return rv; 338 return rv;
339} 339}
340 340
341/* completion of master bio is outside of spinlock. 341/* completion of master bio is outside of our spinlock.
342 * If you need it irqsave, do it your self! 342 * We still may or may not be inside some irqs disabled section
343 * Which means: don't use from bio endio callback. */ 343 * of the lower level driver completion callback, so we need to
344 * spin_lock_irqsave here. */
344static inline int req_mod(struct drbd_request *req, 345static inline int req_mod(struct drbd_request *req,
345 enum drbd_req_event what) 346 enum drbd_req_event what)
346{ 347{
348 unsigned long flags;
347 struct drbd_conf *mdev = req->mdev; 349 struct drbd_conf *mdev = req->mdev;
348 struct bio_and_error m; 350 struct bio_and_error m;
349 int rv; 351 int rv;
350 352
351 spin_lock_irq(&mdev->req_lock); 353 spin_lock_irqsave(&mdev->req_lock, flags);
352 rv = __req_mod(req, what, &m); 354 rv = __req_mod(req, what, &m);
353 spin_unlock_irq(&mdev->req_lock); 355 spin_unlock_irqrestore(&mdev->req_lock, flags);
354 356
355 if (m.bio) 357 if (m.bio)
356 complete_master_bio(mdev, &m); 358 complete_master_bio(mdev, &m);