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,
118 granularity = max(lim->discard_granularity >> 9, 1U);
121 min(lim->max_discard_sectors, bio_allowed_max_sectors(lim));
136 ((lim->discard_alignment >> 9) % granularity);
146 const struct queue_limits *lim,
150 if (!lim->max_write_zeroes_sectors)
152 if (bio_sectors(bio) <= lim->max_write_zeroes_sectors)
154 return bio_split(bio, lim->max_write_zeroes_sectors, GFP_NOIO, bs);
166 const struct queue_limits *lim)
168 unsigned pbs = lim->physical_block_size >> SECTOR_SHIFT;
169 unsigned lbs = lim->logical_block_size >> SECTOR_SHIFT;
170 unsigned max_sectors = lim->max_sectors, start, end;
172 if (lim->chunk_sectors) {
175 lim->chunk_sectors));
187 * @lim: Request queue limits.
193 static inline unsigned get_max_segment_size(const struct queue_limits *lim,
196 unsigned long mask = lim->seg_boundary_mask;
204 return min(mask - offset, (unsigned long)lim->max_segment_size - 1) + 1;
209 * @lim: [in] queue limits to split based on
227 static bool bvec_split_segs(const struct queue_limits *lim,
237 seg_size = get_max_segment_size(lim, bv->bv_page,
245 if ((bv->bv_offset + total_len) & lim->virt_boundary_mask)
258 * @lim: [in] queue limits to split based on
275 struct bio *bio_split_rw(struct bio *bio, const struct queue_limits *lim,
287 if (bvprvp && bvec_gap_to_prev(lim, bvprvp, bv.bv_offset))
290 if (nsegs < lim->max_segments &&
296 if (bvec_split_segs(lim, &bv, &nsegs, &bytes,
297 lim->max_segments, max_bytes))
325 bytes = ALIGN_DOWN(bytes, lim->logical_block_size);
340 * @lim: queue limits to split based on
351 const struct queue_limits *lim,
360 split = bio_split_discard(bio, lim, nr_segs, bs);
363 split = bio_split_write_zeroes(bio, lim, nr_segs, bs);
366 split = bio_split_rw(bio, lim, nr_segs, bs,
367 get_max_io_size(bio, lim) << SECTOR_SHIFT);
399 const struct queue_limits *lim = &bdev_get_queue(bio->bi_bdev)->limits;
402 if (bio_may_exceed_limits(bio, lim))
403 return __bio_split_to_limits(bio, lim, &nr_segs);