aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/md.c
diff options
context:
space:
mode:
authorJens Axboe <axboe@fb.com>2015-11-05 12:41:16 -0500
committerJens Axboe <axboe@fb.com>2015-11-07 12:40:46 -0500
commitdece16353ef47d8d33f5302bc158072a9d65e26f (patch)
tree75438980d0f76c155bab11ddb5f1f1600fcaee13 /drivers/md/md.c
parent8e483ed1342a4ea45b70f0f33ac54eff7a33d918 (diff)
block: change ->make_request_fn() and users to return a queue cookie
No functional changes in this patch, but it prepares us for returning a more useful cookie related to the IO that was queued up. Signed-off-by: Jens Axboe <axboe@fb.com> Acked-by: Christoph Hellwig <hch@lst.de> Acked-by: Keith Busch <keith.busch@intel.com>
Diffstat (limited to 'drivers/md/md.c')
-rw-r--r--drivers/md/md.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c
index 3f9a514b5b9d..807095f4c793 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -250,7 +250,7 @@ static DEFINE_SPINLOCK(all_mddevs_lock);
250 * call has finished, the bio has been linked into some internal structure 250 * call has finished, the bio has been linked into some internal structure
251 * and so is visible to ->quiesce(), so we don't need the refcount any more. 251 * and so is visible to ->quiesce(), so we don't need the refcount any more.
252 */ 252 */
253static void md_make_request(struct request_queue *q, struct bio *bio) 253static blk_qc_t md_make_request(struct request_queue *q, struct bio *bio)
254{ 254{
255 const int rw = bio_data_dir(bio); 255 const int rw = bio_data_dir(bio);
256 struct mddev *mddev = q->queuedata; 256 struct mddev *mddev = q->queuedata;
@@ -262,13 +262,13 @@ static void md_make_request(struct request_queue *q, struct bio *bio)
262 if (mddev == NULL || mddev->pers == NULL 262 if (mddev == NULL || mddev->pers == NULL
263 || !mddev->ready) { 263 || !mddev->ready) {
264 bio_io_error(bio); 264 bio_io_error(bio);
265 return; 265 return BLK_QC_T_NONE;
266 } 266 }
267 if (mddev->ro == 1 && unlikely(rw == WRITE)) { 267 if (mddev->ro == 1 && unlikely(rw == WRITE)) {
268 if (bio_sectors(bio) != 0) 268 if (bio_sectors(bio) != 0)
269 bio->bi_error = -EROFS; 269 bio->bi_error = -EROFS;
270 bio_endio(bio); 270 bio_endio(bio);
271 return; 271 return BLK_QC_T_NONE;
272 } 272 }
273 smp_rmb(); /* Ensure implications of 'active' are visible */ 273 smp_rmb(); /* Ensure implications of 'active' are visible */
274 rcu_read_lock(); 274 rcu_read_lock();
@@ -302,6 +302,8 @@ static void md_make_request(struct request_queue *q, struct bio *bio)
302 302
303 if (atomic_dec_and_test(&mddev->active_io) && mddev->suspended) 303 if (atomic_dec_and_test(&mddev->active_io) && mddev->suspended)
304 wake_up(&mddev->sb_wait); 304 wake_up(&mddev->sb_wait);
305
306 return BLK_QC_T_NONE;
305} 307}
306 308
307/* mddev_suspend makes sure no new requests are submitted 309/* mddev_suspend makes sure no new requests are submitted