blk-map.c (0a2481cde24f78f503cbc066df2c9c160e64cfd6) blk-map.c (de4f5fed3f231a8ff4790bf52975f847b95b85ea)
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Functions related to mapping data to requests
4 */
5#include <linux/kernel.h>
6#include <linux/sched/task_stack.h>
7#include <linux/module.h>
8#include <linux/bio.h>

--- 17 unchanged lines hidden (view full) ---

26 if (data->nr_segs > UIO_MAXIOV)
27 return NULL;
28
29 bmd = kmalloc(struct_size(bmd, iov, data->nr_segs), gfp_mask);
30 if (!bmd)
31 return NULL;
32 bmd->iter = *data;
33 if (iter_is_iovec(data)) {
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Functions related to mapping data to requests
4 */
5#include <linux/kernel.h>
6#include <linux/sched/task_stack.h>
7#include <linux/module.h>
8#include <linux/bio.h>

--- 17 unchanged lines hidden (view full) ---

26 if (data->nr_segs > UIO_MAXIOV)
27 return NULL;
28
29 bmd = kmalloc(struct_size(bmd, iov, data->nr_segs), gfp_mask);
30 if (!bmd)
31 return NULL;
32 bmd->iter = *data;
33 if (iter_is_iovec(data)) {
34 memcpy(bmd->iov, data->iov, sizeof(struct iovec) * data->nr_segs);
35 bmd->iter.iov = bmd->iov;
34 memcpy(bmd->iov, iter_iov(data), sizeof(struct iovec) * data->nr_segs);
35 bmd->iter.__iov = bmd->iov;
36 }
37 return bmd;
38}
39
40/**
41 * bio_copy_from_iter - copy all pages from iov_iter to bio
42 * @bio: The &struct bio which describes the I/O as destination
43 * @iter: iov_iter as source

--- 765 unchanged lines hidden ---
36 }
37 return bmd;
38}
39
40/**
41 * bio_copy_from_iter - copy all pages from iov_iter to bio
42 * @bio: The &struct bio which describes the I/O as destination
43 * @iter: iov_iter as source

--- 765 unchanged lines hidden ---