Skip to content

Commit 3841746

Browse files
Christoph Hellwigmartinkpetersen
authored andcommitted
scsi: block: remove the cluster flag
Now that the the SCSI layer replaced the use of the cluster flag with segment size limits and the DMA boundary we can remove the cluster flag from the block layer. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Jens Axboe <axboe@kernel.dk> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
1 parent d6a9000 commit 3841746

File tree

4 files changed

+8
-24
lines changed

4 files changed

+8
-24
lines changed

block/blk-merge.c

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ static struct bio *blk_bio_segment_split(struct request_queue *q,
194194
goto split;
195195
}
196196

197-
if (bvprvp && blk_queue_cluster(q)) {
197+
if (bvprvp) {
198198
if (seg_size + bv.bv_len > queue_max_segment_size(q))
199199
goto new_segment;
200200
if (!biovec_phys_mergeable(q, bvprvp, &bv))
@@ -294,7 +294,7 @@ static unsigned int __blk_recalc_rq_segments(struct request_queue *q,
294294
bool no_sg_merge)
295295
{
296296
struct bio_vec bv, bvprv = { NULL };
297-
int cluster, prev = 0;
297+
int prev = 0;
298298
unsigned int seg_size, nr_phys_segs;
299299
struct bio *fbio, *bbio;
300300
struct bvec_iter iter;
@@ -312,7 +312,6 @@ static unsigned int __blk_recalc_rq_segments(struct request_queue *q,
312312
}
313313

314314
fbio = bio;
315-
cluster = blk_queue_cluster(q);
316315
seg_size = 0;
317316
nr_phys_segs = 0;
318317
for_each_bio(bio) {
@@ -324,7 +323,7 @@ static unsigned int __blk_recalc_rq_segments(struct request_queue *q,
324323
if (no_sg_merge)
325324
goto new_segment;
326325

327-
if (prev && cluster) {
326+
if (prev) {
328327
if (seg_size + bv.bv_len
329328
> queue_max_segment_size(q))
330329
goto new_segment;
@@ -395,9 +394,6 @@ static int blk_phys_contig_segment(struct request_queue *q, struct bio *bio,
395394
{
396395
struct bio_vec end_bv = { NULL }, nxt_bv;
397396

398-
if (!blk_queue_cluster(q))
399-
return 0;
400-
401397
if (bio->bi_seg_back_size + nxt->bi_seg_front_size >
402398
queue_max_segment_size(q))
403399
return 0;
@@ -414,12 +410,12 @@ static int blk_phys_contig_segment(struct request_queue *q, struct bio *bio,
414410
static inline void
415411
__blk_segment_map_sg(struct request_queue *q, struct bio_vec *bvec,
416412
struct scatterlist *sglist, struct bio_vec *bvprv,
417-
struct scatterlist **sg, int *nsegs, int *cluster)
413+
struct scatterlist **sg, int *nsegs)
418414
{
419415

420416
int nbytes = bvec->bv_len;
421417

422-
if (*sg && *cluster) {
418+
if (*sg) {
423419
if ((*sg)->length + nbytes > queue_max_segment_size(q))
424420
goto new_segment;
425421
if (!biovec_phys_mergeable(q, bvprv, bvec))
@@ -465,12 +461,12 @@ static int __blk_bios_map_sg(struct request_queue *q, struct bio *bio,
465461
{
466462
struct bio_vec bvec, bvprv = { NULL };
467463
struct bvec_iter iter;
468-
int cluster = blk_queue_cluster(q), nsegs = 0;
464+
int nsegs = 0;
469465

470466
for_each_bio(bio)
471467
bio_for_each_segment(bvec, bio, iter)
472468
__blk_segment_map_sg(q, &bvec, sglist, &bvprv, sg,
473-
&nsegs, &cluster);
469+
&nsegs);
474470

475471
return nsegs;
476472
}

block/blk-settings.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,6 @@ void blk_set_default_limits(struct queue_limits *lim)
109109
lim->alignment_offset = 0;
110110
lim->io_opt = 0;
111111
lim->misaligned = 0;
112-
lim->cluster = 1;
113112
lim->zoned = BLK_ZONED_NONE;
114113
}
115114
EXPORT_SYMBOL(blk_set_default_limits);
@@ -602,8 +601,6 @@ int blk_stack_limits(struct queue_limits *t, struct queue_limits *b,
602601
t->io_min = max(t->io_min, b->io_min);
603602
t->io_opt = lcm_not_zero(t->io_opt, b->io_opt);
604603

605-
t->cluster &= b->cluster;
606-
607604
/* Physical block size a multiple of the logical block size? */
608605
if (t->physical_block_size & (t->logical_block_size - 1)) {
609606
t->physical_block_size = t->logical_block_size;

block/blk-sysfs.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,10 +136,7 @@ static ssize_t queue_max_integrity_segments_show(struct request_queue *q, char *
136136

137137
static ssize_t queue_max_segment_size_show(struct request_queue *q, char *page)
138138
{
139-
if (blk_queue_cluster(q))
140-
return queue_var_show(queue_max_segment_size(q), (page));
141-
142-
return queue_var_show(PAGE_SIZE, (page));
139+
return queue_var_show(queue_max_segment_size(q), (page));
143140
}
144141

145142
static ssize_t queue_logical_block_size_show(struct request_queue *q, char *page)

include/linux/blkdev.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,6 @@ struct queue_limits {
389389

390390
unsigned char misaligned;
391391
unsigned char discard_misaligned;
392-
unsigned char cluster;
393392
unsigned char raid_partial_stripes_expensive;
394393
enum blk_zoned_model zoned;
395394
};
@@ -785,11 +784,6 @@ static inline bool queue_is_rq_based(struct request_queue *q)
785784
return q->request_fn || q->mq_ops;
786785
}
787786

788-
static inline unsigned int blk_queue_cluster(struct request_queue *q)
789-
{
790-
return q->limits.cluster;
791-
}
792-
793787
static inline enum blk_zoned_model
794788
blk_queue_zoned_model(struct request_queue *q)
795789
{

0 commit comments

Comments
 (0)