bio.c (29b2a3aa296711cfdadafbf627c2d9a388fc84ee) bio.c (a892c8d52c02284076fbbacae6692aa5c5807d11)
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Copyright (C) 2001 Jens Axboe <axboe@kernel.dk>
4 */
5#include <linux/mm.h>
6#include <linux/swap.h>
7#include <linux/bio.h>
8#include <linux/blkdev.h>

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

13#include <linux/kernel.h>
14#include <linux/export.h>
15#include <linux/mempool.h>
16#include <linux/workqueue.h>
17#include <linux/cgroup.h>
18#include <linux/blk-cgroup.h>
19#include <linux/highmem.h>
20#include <linux/sched/sysctl.h>
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Copyright (C) 2001 Jens Axboe <axboe@kernel.dk>
4 */
5#include <linux/mm.h>
6#include <linux/swap.h>
7#include <linux/bio.h>
8#include <linux/blkdev.h>

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

13#include <linux/kernel.h>
14#include <linux/export.h>
15#include <linux/mempool.h>
16#include <linux/workqueue.h>
17#include <linux/cgroup.h>
18#include <linux/blk-cgroup.h>
19#include <linux/highmem.h>
20#include <linux/sched/sysctl.h>
21#include <linux/blk-crypto.h>
21
22#include <trace/events/block.h>
23#include "blk.h"
24#include "blk-rq-qos.h"
25
26/*
27 * Test patch to inline a certain number of bi_io_vec's inside the bio
28 * itself, to shrink a bio data allocation from two mempool calls to one

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

232}
233
234void bio_uninit(struct bio *bio)
235{
236 bio_disassociate_blkg(bio);
237
238 if (bio_integrity(bio))
239 bio_integrity_free(bio);
22
23#include <trace/events/block.h>
24#include "blk.h"
25#include "blk-rq-qos.h"
26
27/*
28 * Test patch to inline a certain number of bi_io_vec's inside the bio
29 * itself, to shrink a bio data allocation from two mempool calls to one

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

233}
234
235void bio_uninit(struct bio *bio)
236{
237 bio_disassociate_blkg(bio);
238
239 if (bio_integrity(bio))
240 bio_integrity_free(bio);
241
242 bio_crypt_free_ctx(bio);
240}
241EXPORT_SYMBOL(bio_uninit);
242
243static void bio_free(struct bio *bio)
244{
245 struct bio_set *bs = bio->bi_pool;
246 void *p;
247

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

703 struct bio *b;
704
705 b = bio_alloc_bioset(gfp_mask, 0, bs);
706 if (!b)
707 return NULL;
708
709 __bio_clone_fast(b, bio);
710
243}
244EXPORT_SYMBOL(bio_uninit);
245
246static void bio_free(struct bio *bio)
247{
248 struct bio_set *bs = bio->bi_pool;
249 void *p;
250

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

706 struct bio *b;
707
708 b = bio_alloc_bioset(gfp_mask, 0, bs);
709 if (!b)
710 return NULL;
711
712 __bio_clone_fast(b, bio);
713
714 bio_crypt_clone(b, bio, gfp_mask);
715
711 if (bio_integrity(bio)) {
712 int ret;
713
714 ret = bio_integrity_clone(b, bio, gfp_mask);
715
716 if (ret < 0) {
717 bio_put(b);
718 return NULL;

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

1167 *
1168 * @bio will then represent the remaining, uncompleted portion of the io.
1169 */
1170void bio_advance(struct bio *bio, unsigned bytes)
1171{
1172 if (bio_integrity(bio))
1173 bio_integrity_advance(bio, bytes);
1174
716 if (bio_integrity(bio)) {
717 int ret;
718
719 ret = bio_integrity_clone(b, bio, gfp_mask);
720
721 if (ret < 0) {
722 bio_put(b);
723 return NULL;

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

1172 *
1173 * @bio will then represent the remaining, uncompleted portion of the io.
1174 */
1175void bio_advance(struct bio *bio, unsigned bytes)
1176{
1177 if (bio_integrity(bio))
1178 bio_integrity_advance(bio, bytes);
1179
1180 bio_crypt_advance(bio, bytes);
1175 bio_advance_iter(bio, &bio->bi_iter, bytes);
1176}
1177EXPORT_SYMBOL(bio_advance);
1178
1179void bio_copy_data_iter(struct bio *dst, struct bvec_iter *dst_iter,
1180 struct bio *src, struct bvec_iter *src_iter)
1181{
1182 struct bio_vec src_bv, dst_bv;

--- 667 unchanged lines hidden ---
1181 bio_advance_iter(bio, &bio->bi_iter, bytes);
1182}
1183EXPORT_SYMBOL(bio_advance);
1184
1185void bio_copy_data_iter(struct bio *dst, struct bvec_iter *dst_iter,
1186 struct bio *src, struct bvec_iter *src_iter)
1187{
1188 struct bio_vec src_bv, dst_bv;

--- 667 unchanged lines hidden ---