From 6e76ff4f38b3c21ebf90a2ef9debb1defcffe36c Mon Sep 17 00:00:00 2001 From: Philipp Reisner Date: Wed, 9 Jun 2010 14:07:43 +0200 Subject: [PATCH] --- yaml --- r: 213095 b: refs/heads/master c: 2a80699f807885d501f08a7006f6a56c1c937a6e h: refs/heads/master i: 213093: e77584523780bf733e599b4e9b51e9a9cff44ba1 213091: 92c08a5e0af02194fe4b4b121fbee0b0c0393f91 213087: f6707b16f529202d7dcef0ec149fa487ebf84941 v: v3 --- [refs] | 2 +- trunk/drivers/block/drbd/drbd_req.c | 5 ++++- trunk/drivers/block/drbd/drbd_req.h | 17 ++++++++++++----- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/[refs] b/[refs] index 3c5b71048cbf..20ce39b15646 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 288f422ec13667de40b278535d2a5fb5c77352c4 +refs/heads/master: 2a80699f807885d501f08a7006f6a56c1c937a6e diff --git a/trunk/drivers/block/drbd/drbd_req.c b/trunk/drivers/block/drbd/drbd_req.c index 4a30e2cae56d..d9df1a1c40b9 100644 --- a/trunk/drivers/block/drbd/drbd_req.c +++ b/trunk/drivers/block/drbd/drbd_req.c @@ -382,10 +382,11 @@ static int _req_conflicts(struct drbd_request *req) * and it enforces that we have to think in a very structured manner * about the "events" that may happen to a request during its life time ... */ -void __req_mod(struct drbd_request *req, enum drbd_req_event what, +int __req_mod(struct drbd_request *req, enum drbd_req_event what, struct bio_and_error *m) { struct drbd_conf *mdev = req->mdev; + int rv = 0; m->bio = NULL; switch (what) { @@ -657,6 +658,8 @@ void __req_mod(struct drbd_request *req, enum drbd_req_event what, _req_may_be_done(req, m); break; }; + + return rv; } /* we may do a local read if: diff --git a/trunk/drivers/block/drbd/drbd_req.h b/trunk/drivers/block/drbd/drbd_req.h index 47b931fe0366..db37c6e47fa9 100644 --- a/trunk/drivers/block/drbd/drbd_req.h +++ b/trunk/drivers/block/drbd/drbd_req.h @@ -297,36 +297,43 @@ struct bio_and_error { extern void _req_may_be_done(struct drbd_request *req, struct bio_and_error *m); -extern void __req_mod(struct drbd_request *req, enum drbd_req_event what, +extern int __req_mod(struct drbd_request *req, enum drbd_req_event what, struct bio_and_error *m); extern void complete_master_bio(struct drbd_conf *mdev, struct bio_and_error *m); /* use this if you don't want to deal with calling complete_master_bio() * outside the spinlock, e.g. when walking some list on cleanup. */ -static inline void _req_mod(struct drbd_request *req, enum drbd_req_event what) +static inline int _req_mod(struct drbd_request *req, enum drbd_req_event what) { struct drbd_conf *mdev = req->mdev; struct bio_and_error m; + int rv; /* __req_mod possibly frees req, do not touch req after that! */ - __req_mod(req, what, &m); + rv = __req_mod(req, what, &m); if (m.bio) complete_master_bio(mdev, &m); + + return rv; } /* completion of master bio is outside of spinlock. * If you need it irqsave, do it your self! */ -static inline void req_mod(struct drbd_request *req, +static inline int req_mod(struct drbd_request *req, enum drbd_req_event what) { struct drbd_conf *mdev = req->mdev; struct bio_and_error m; + int rv; + spin_lock_irq(&mdev->req_lock); - __req_mod(req, what, &m); + rv = __req_mod(req, what, &m); spin_unlock_irq(&mdev->req_lock); if (m.bio) complete_master_bio(mdev, &m); + + return rv; } #endif