History

Merge tag 'block-5.5-2020-01-10' of git://git.kernel.dk/linux-block

Pull block fixes from Jens Axboe: "A few fixes that should go into this round. This pull request contains two NVMe fixes via Keith, removal of a dead function, and a fix for the bio op for read truncates (Ming)" * tag 'block-5.5-2020-01-10' of git://git.kernel.dk/linux-block: nvmet: fix per feat data len for get_feature nvme: Translate more status codes to blk_status_t fs: move guard_bio_eod() after bio_set_op_attrs block: remove unused mp_bvec_last_segment

Linus Torvalds committed 6 years ago

Commit 4e4cd212 parents 30b6487 e17016f7 files · +30 −30Browse files

Showing the changes to include/linux (1 of 7 files). Show all

Unified · Split

include/linux/bvec.h+0−22
@@ -153,26 +153,4 @@ static inline void bvec_advance(const struct bio_vec *bvec, · 152 unmodified lines
153 }153 }
154}154}
155 155
156/*
157 * Get the last single-page segment from the multi-page bvec and store it
158 * in @seg
159 */
160static inline void mp_bvec_last_segment(const struct bio_vec *bvec,
161 struct bio_vec *seg)
162{
163 unsigned total = bvec->bv_offset + bvec->bv_len;
164 unsigned last_page = (total - 1) / PAGE_SIZE;
165
166 seg->bv_page = bvec->bv_page + last_page;
167
168 /* the whole segment is inside the last page */
169 if (bvec->bv_offset >= last_page * PAGE_SIZE) {
170 seg->bv_offset = bvec->bv_offset % PAGE_SIZE;
171 seg->bv_len = bvec->bv_len;
172 } else {
173 seg->bv_offset = 0;
174 seg->bv_len = total - last_page * PAGE_SIZE;
175 }
176}
177
178#endif /* __LINUX_BVEC_ITER_H */156#endif /* __LINUX_BVEC_ITER_H */