Skip to content

Commit

Permalink
block: remove unused mp_bvec_last_segment
Browse files Browse the repository at this point in the history
After commit 85a8ce6 ("block: add bio_truncate to fix guard_bio_eod")
this function is unused, remove it.

Reviewed-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
  • Loading branch information
Jens Axboe committed Jan 5, 2020
1 parent c7d776f commit 5741579
Showing 1 changed file with 0 additions and 22 deletions.
22 changes: 0 additions & 22 deletions include/linux/bvec.h
Original file line number Diff line number Diff line change
Expand Up @@ -153,26 +153,4 @@ static inline void bvec_advance(const struct bio_vec *bvec,
}
}

/*
* Get the last single-page segment from the multi-page bvec and store it
* in @seg
*/
static inline void mp_bvec_last_segment(const struct bio_vec *bvec,
struct bio_vec *seg)
{
unsigned total = bvec->bv_offset + bvec->bv_len;
unsigned last_page = (total - 1) / PAGE_SIZE;

seg->bv_page = bvec->bv_page + last_page;

/* the whole segment is inside the last page */
if (bvec->bv_offset >= last_page * PAGE_SIZE) {
seg->bv_offset = bvec->bv_offset % PAGE_SIZE;
seg->bv_len = bvec->bv_len;
} else {
seg->bv_offset = 0;
seg->bv_len = total - last_page * PAGE_SIZE;
}
}

#endif /* __LINUX_BVEC_ITER_H */

0 comments on commit 5741579

Please sign in to comment.