drm/nouveau: use bo->base.size instead of mem->num_pages
[linux-2.6-microblaze.git] / drivers / target / target_core_pscsi.c
index 33770e5..3cbc074 100644 (file)
@@ -881,7 +881,7 @@ pscsi_map_sg(struct se_cmd *cmd, struct scatterlist *sgl, u32 sgl_nents,
 
                        if (!bio) {
 new_bio:
-                               nr_vecs = min_t(int, BIO_MAX_PAGES, nr_pages);
+                               nr_vecs = bio_max_segs(nr_pages);
                                nr_pages -= nr_vecs;
                                /*
                                 * Calls bio_kmalloc() and sets bio->bi_end_io()