bio.h (3e1a88ec96259282b9a8b45c3f1fda7a3ff4f6ea) | bio.h (c42bca92be928ce7dece5fc04cf68d0e37ee6718) |
---|---|
1/* SPDX-License-Identifier: GPL-2.0 */ 2/* 3 * Copyright (C) 2001 Jens Axboe <axboe@suse.de> 4 */ 5#ifndef __LINUX_BIO_H 6#define __LINUX_BIO_H 7 8#include <linux/highmem.h> --- 430 unchanged lines hidden (view full) --- 439{ 440 bio_set_flag(bio, BIO_QUIET); 441 bio->bi_status = BLK_STS_AGAIN; 442 bio_endio(bio); 443} 444 445/* 446 * Calculate number of bvec segments that should be allocated to fit data | 1/* SPDX-License-Identifier: GPL-2.0 */ 2/* 3 * Copyright (C) 2001 Jens Axboe <axboe@suse.de> 4 */ 5#ifndef __LINUX_BIO_H 6#define __LINUX_BIO_H 7 8#include <linux/highmem.h> --- 430 unchanged lines hidden (view full) --- 439{ 440 bio_set_flag(bio, BIO_QUIET); 441 bio->bi_status = BLK_STS_AGAIN; 442 bio_endio(bio); 443} 444 445/* 446 * Calculate number of bvec segments that should be allocated to fit data |
447 * pointed by @iter. | 447 * pointed by @iter. If @iter is backed by bvec it's going to be reused 448 * instead of allocating a new one. |
448 */ 449static inline int bio_iov_vecs_to_alloc(struct iov_iter *iter, int max_segs) 450{ | 449 */ 450static inline int bio_iov_vecs_to_alloc(struct iov_iter *iter, int max_segs) 451{ |
452 if (iov_iter_is_bvec(iter)) 453 return 0; |
|
451 return iov_iter_npages(iter, max_segs); 452} 453 454struct request_queue; 455 456extern int submit_bio_wait(struct bio *bio); 457extern void bio_advance(struct bio *, unsigned); 458 --- 373 unchanged lines hidden --- | 454 return iov_iter_npages(iter, max_segs); 455} 456 457struct request_queue; 458 459extern int submit_bio_wait(struct bio *bio); 460extern void bio_advance(struct bio *, unsigned); 461 --- 373 unchanged lines hidden --- |