]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - block/bio.c
bdi: Fix another oops in wb_workfn()
[linux.git] / block / bio.c
index 5f7563598b1ccd0978ef8eae5feaf14a37cf1399..f7e3d88bd0b6bb9398a01148149bb6be701e7ec8 100644 (file)
@@ -1807,9 +1807,6 @@ void bio_endio(struct bio *bio)
        if (!bio_integrity_endio(bio))
                return;
 
-       if (WARN_ONCE(bio->bi_next, "driver left bi_next not NULL"))
-               bio->bi_next = NULL;
-
        /*
         * Need to have a real endio function for chained bios, otherwise
         * various corner cases will break (like stacking block devices that
@@ -1997,6 +1994,24 @@ int bioset_init(struct bio_set *bs,
 }
 EXPORT_SYMBOL(bioset_init);
 
+/*
+ * Initialize and setup a new bio_set, based on the settings from
+ * another bio_set.
+ */
+int bioset_init_from_src(struct bio_set *bs, struct bio_set *src)
+{
+       int flags;
+
+       flags = 0;
+       if (src->bvec_pool.min_nr)
+               flags |= BIOSET_NEED_BVECS;
+       if (src->rescue_workqueue)
+               flags |= BIOSET_NEED_RESCUER;
+
+       return bioset_init(bs, src->bio_pool.min_nr, src->front_pad, flags);
+}
+EXPORT_SYMBOL(bioset_init_from_src);
+
 #ifdef CONFIG_BLK_CGROUP
 
 /**