blk-merge.c (2c55d703391acf7e9101da596d0c15ee03b318a3) blk-merge.c (613b14884b8595e20b9fac4126bf627313827fbe)
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Functions related to segment and merge handling
4 */
5#include <linux/kernel.h>
6#include <linux/module.h>
7#include <linux/bio.h>
8#include <linux/blkdev.h>

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

353 split = bio_split_discard(bio, lim, nr_segs, bs);
354 break;
355 case REQ_OP_WRITE_ZEROES:
356 split = bio_split_write_zeroes(bio, lim, nr_segs, bs);
357 break;
358 default:
359 split = bio_split_rw(bio, lim, nr_segs, bs,
360 get_max_io_size(bio, lim) << SECTOR_SHIFT);
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Functions related to segment and merge handling
4 */
5#include <linux/kernel.h>
6#include <linux/module.h>
7#include <linux/bio.h>
8#include <linux/blkdev.h>

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

353 split = bio_split_discard(bio, lim, nr_segs, bs);
354 break;
355 case REQ_OP_WRITE_ZEROES:
356 split = bio_split_write_zeroes(bio, lim, nr_segs, bs);
357 break;
358 default:
359 split = bio_split_rw(bio, lim, nr_segs, bs,
360 get_max_io_size(bio, lim) << SECTOR_SHIFT);
361 if (IS_ERR(split))
362 return NULL;
361 break;
362 }
363
364 if (split) {
363 break;
364 }
365
366 if (split) {
365 /* there isn't chance to merge the splitted bio */
367 /* there isn't chance to merge the split bio */
366 split->bi_opf |= REQ_NOMERGE;
367
368 blkcg_bio_issue_init(split);
369 bio_chain(split, bio);
370 trace_block_split(split, bio->bi_iter.bi_sector);
371 submit_bio_noacct(bio);
372 return split;
373 }

--- 778 unchanged lines hidden ---
368 split->bi_opf |= REQ_NOMERGE;
369
370 blkcg_bio_issue_init(split);
371 bio_chain(split, bio);
372 trace_block_split(split, bio->bi_iter.bi_sector);
373 submit_bio_noacct(bio);
374 return split;
375 }

--- 778 unchanged lines hidden ---