Lines Matching refs:lim
103 static unsigned int bio_allowed_max_sectors(const struct queue_limits *lim)
105 return round_down(UINT_MAX, lim->logical_block_size) >> SECTOR_SHIFT;
109 const struct queue_limits *lim,
119 granularity = max(lim->discard_granularity >> 9, 1U);
122 min(lim->max_discard_sectors, bio_allowed_max_sectors(lim));
140 ((lim->discard_alignment >> 9) % granularity);
150 const struct queue_limits *lim,
154 if (!lim->max_write_zeroes_sectors)
156 if (bio_sectors(bio) <= lim->max_write_zeroes_sectors)
158 return bio_split(bio, lim->max_write_zeroes_sectors, GFP_NOIO, bs);
170 const struct queue_limits *lim)
172 unsigned pbs = lim->physical_block_size >> SECTOR_SHIFT;
173 unsigned lbs = lim->logical_block_size >> SECTOR_SHIFT;
174 unsigned max_sectors = lim->max_sectors, start, end;
176 if (lim->chunk_sectors) {
179 lim->chunk_sectors));
191 * @lim: Request queue limits.
197 static inline unsigned get_max_segment_size(const struct queue_limits *lim,
200 unsigned long mask = lim->seg_boundary_mask;
208 return min(mask - offset, (unsigned long)lim->max_segment_size - 1) + 1;
213 * @lim: [in] queue limits to split based on
231 static bool bvec_split_segs(const struct queue_limits *lim,
241 seg_size = get_max_segment_size(lim, bv->bv_page,
249 if ((bv->bv_offset + total_len) & lim->virt_boundary_mask)
262 * @lim: [in] queue limits to split based on
279 struct bio *bio_split_rw(struct bio *bio, const struct queue_limits *lim,
291 if (bvprvp && bvec_gap_to_prev(lim, bvprvp, bv.bv_offset))
294 if (nsegs < lim->max_segments &&
300 if (bvec_split_segs(lim, &bv, &nsegs, &bytes,
301 lim->max_segments, max_bytes))
329 bytes = ALIGN_DOWN(bytes, lim->logical_block_size);
344 * @lim: queue limits to split based on
355 const struct queue_limits *lim,
364 split = bio_split_discard(bio, lim, nr_segs, bs);
367 split = bio_split_write_zeroes(bio, lim, nr_segs, bs);
370 split = bio_split_rw(bio, lim, nr_segs, bs,
371 get_max_io_size(bio, lim) << SECTOR_SHIFT);
403 const struct queue_limits *lim = &bdev_get_queue(bio->bi_bdev)->limits;
406 if (bio_may_exceed_limits(bio, lim))
407 return __bio_split_to_limits(bio, lim, &nr_segs);