Skip to content

Commit b7b1641

Browse files
author
Ming Lei
committed
block: remove zone append special casing from the direct I/O path
JIRA: https://issues.redhat.com/browse/RHEL-68422 commit cafd00d Author: Christoph Hellwig <[email protected]> Date: Wed Oct 30 06:18:51 2024 +0100 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]> Signed-off-by: Ming Lei <[email protected]>
1 parent 7312a9d commit b7b1641

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
@@ -1202,21 +1202,12 @@ EXPORT_SYMBOL_GPL(__bio_release_pages);
12021202

12031203
void bio_iov_bvec_set(struct bio *bio, struct iov_iter *iter)
12041204
{
1205-
size_t size = iov_iter_count(iter);
1206-
12071205
WARN_ON_ONCE(bio->bi_max_vecs);
12081206

1209-
if (bio_op(bio) == REQ_OP_ZONE_APPEND) {
1210-
struct request_queue *q = bdev_get_queue(bio->bi_bdev);
1211-
size_t max_sectors = queue_max_zone_append_sectors(q);
1212-
1213-
size = min(size, max_sectors << SECTOR_SHIFT);
1214-
}
1215-
12161207
bio->bi_vcnt = iter->nr_segs;
12171208
bio->bi_io_vec = (struct bio_vec *)iter->bvec;
12181209
bio->bi_iter.bi_bvec_done = iter->iov_offset;
1219-
bio->bi_iter.bi_size = size;
1210+
bio->bi_iter.bi_size = iov_iter_count(iter);
12201211
bio_set_flag(bio, BIO_CLONED);
12211212
}
12221213

@@ -1241,20 +1232,6 @@ static int bio_iov_add_folio(struct bio *bio, struct folio *folio, size_t len,
12411232
return 0;
12421233
}
12431234

1244-
static int bio_iov_add_zone_append_folio(struct bio *bio, struct folio *folio,
1245-
size_t len, size_t offset)
1246-
{
1247-
struct request_queue *q = bdev_get_queue(bio->bi_bdev);
1248-
bool same_page = false;
1249-
1250-
if (bio_add_hw_folio(q, bio, folio, len, offset,
1251-
queue_max_zone_append_sectors(q), &same_page) != len)
1252-
return -EINVAL;
1253-
if (same_page && bio_flagged(bio, BIO_PAGE_PINNED))
1254-
unpin_user_folio(folio, 1);
1255-
return 0;
1256-
}
1257-
12581235
static unsigned int get_contig_folio_len(unsigned int *num_pages,
12591236
struct page **pages, unsigned int i,
12601237
struct folio *folio, size_t left,
@@ -1361,14 +1338,7 @@ static int __bio_iov_iter_get_pages(struct bio *bio, struct iov_iter *iter)
13611338
len = get_contig_folio_len(&num_pages, pages, i,
13621339
folio, left, offset);
13631340

1364-
if (bio_op(bio) == REQ_OP_ZONE_APPEND) {
1365-
ret = bio_iov_add_zone_append_folio(bio, folio, len,
1366-
folio_offset);
1367-
if (ret)
1368-
break;
1369-
} else
1370-
bio_iov_add_folio(bio, folio, len, folio_offset);
1371-
1341+
bio_iov_add_folio(bio, folio, len, folio_offset);
13721342
offset = 0;
13731343
}
13741344

0 commit comments

Comments
 (0)