blk-map.c (cecdd52a3dd312564f81a39df08378b7b39a2654) blk-map.c (0a2481cde24f78f503cbc066df2c9c160e64cfd6)
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>

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

24 struct bio_map_data *bmd;
25
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;
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>

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

24 struct bio_map_data *bmd;
25
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 memcpy(bmd->iov, data->iov, sizeof(struct iovec) * data->nr_segs);
33 bmd->iter = *data;
32 bmd->iter = *data;
34 if (iter_is_iovec(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;
35 bmd->iter.iov = bmd->iov;
36 }
36 return bmd;
37}
38
39/**
40 * bio_copy_from_iter - copy all pages from iov_iter to bio
41 * @bio: The &struct bio which describes the I/O as destination
42 * @iter: iov_iter as source
43 *

--- 764 unchanged lines hidden ---
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
44 *

--- 764 unchanged lines hidden ---