]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - block/blk-core.c
drm/amd/display: Create dpcd and i2c packing functions
[linux.git] / block / blk-core.c
index 5d1fc8e17dd168a7e2723b2a90699491ccad06bd..d0cc6e14d2f0748e91001d770cbebfa091066889 100644 (file)
@@ -117,6 +117,7 @@ void blk_rq_init(struct request_queue *q, struct request *rq)
        rq->internal_tag = -1;
        rq->start_time_ns = ktime_get_ns();
        rq->part = NULL;
+       refcount_set(&rq->ref, 1);
 }
 EXPORT_SYMBOL(blk_rq_init);
 
@@ -687,7 +688,7 @@ bool blk_attempt_plug_merge(struct request_queue *q, struct bio *bio,
        struct request *rq;
        struct list_head *plug_list;
 
-       plug = current->plug;
+       plug = blk_mq_plug(q, bio);
        if (!plug)
                return false;
 
@@ -1127,6 +1128,9 @@ EXPORT_SYMBOL_GPL(direct_make_request);
  */
 blk_qc_t submit_bio(struct bio *bio)
 {
+       if (blkcg_punt_bio_submit(bio))
+               return BLK_QC_T_NONE;
+
        /*
         * If it's a regular read/write or a barrier with data attached,
         * go through the normal accounting stuff before submission.