Skip to content

Commit cafd00d

Browse files
Christoph Hellwigaxboe
authored andcommitted
block: remove zone append special casing from the direct I/O path
This code is unused, and all future zoned file systems should follow the btrfs lead of splitting the bios themselves to the zoned limits in the I/O submission handler, because if they didn't they would be hit by commit ed9832b ("block: introduce folio awareness and add a bigger size from folio") breaking this code when the zone append limit (that is usually the max_hw_sectors limit) is smaller than the largest possible folio size. Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Chaitanya Kulkarni <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
1 parent 496a51b commit cafd00d

File tree

1 file changed

+2
-32
lines changed

1 file changed

+2
-32
lines changed

block/bio.c

Lines changed: 2 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1206,21 +1206,12 @@ EXPORT_SYMBOL_GPL(__bio_release_pages);
12061206

12071207
void bio_iov_bvec_set(struct bio *bio, struct iov_iter *iter)
12081208
{
1209-
size_t size = iov_iter_count(iter);
1210-
12111209
WARN_ON_ONCE(bio->bi_max_vecs);
12121210

1213-
if (bio_op(bio) == REQ_OP_ZONE_APPEND) {
1214-
struct request_queue *q = bdev_get_queue(bio->bi_bdev);
1215-
size_t max_sectors = queue_max_zone_append_sectors(q);
1216-
1217-
size = min(size, max_sectors << SECTOR_SHIFT);
1218-
}
1219-
12201211
bio->bi_vcnt = iter->nr_segs;
12211212
bio->bi_io_vec = (struct bio_vec *)iter->bvec;
12221213
bio->bi_iter.bi_bvec_done = iter->iov_offset;
1223-
bio->bi_iter.bi_size = size;
1214+
bio->bi_iter.bi_size = iov_iter_count(iter);
12241215
bio_set_flag(bio, BIO_CLONED);
12251216
}
12261217

@@ -1245,20 +1236,6 @@ static int bio_iov_add_folio(struct bio *bio, struct folio *folio, size_t len,
12451236
return 0;
12461237
}
12471238

1248-
static int bio_iov_add_zone_append_folio(struct bio *bio, struct folio *folio,
1249-
size_t len, size_t offset)
1250-
{
1251-
struct request_queue *q = bdev_get_queue(bio->bi_bdev);
1252-
bool same_page = false;
1253-
1254-
if (bio_add_hw_folio(q, bio, folio, len, offset,
1255-
queue_max_zone_append_sectors(q), &same_page) != len)
1256-
return -EINVAL;
1257-
if (same_page && bio_flagged(bio, BIO_PAGE_PINNED))
1258-
unpin_user_folio(folio, 1);
1259-
return 0;
1260-
}
1261-
12621239
static unsigned int get_contig_folio_len(unsigned int *num_pages,
12631240
struct page **pages, unsigned int i,
12641241
struct folio *folio, size_t left,
@@ -1365,14 +1342,7 @@ static int __bio_iov_iter_get_pages(struct bio *bio, struct iov_iter *iter)
13651342
len = get_contig_folio_len(&num_pages, pages, i,
13661343
folio, left, offset);
13671344

1368-
if (bio_op(bio) == REQ_OP_ZONE_APPEND) {
1369-
ret = bio_iov_add_zone_append_folio(bio, folio, len,
1370-
folio_offset);
1371-
if (ret)
1372-
break;
1373-
} else
1374-
bio_iov_add_folio(bio, folio, len, folio_offset);
1375-
1345+
bio_iov_add_folio(bio, folio, len, folio_offset);
13761346
offset = 0;
13771347
}
13781348

0 commit comments

Comments
 (0)