diff options
author | Bart Van Assche <bvanassche@acm.org> | 2024-02-02 12:39:25 -0800 |
---|---|---|
committer | Christian Brauner <brauner@kernel.org> | 2024-02-06 14:31:05 +0100 |
commit | 449813515d3e5efec85206bb91588a6249a421a3 (patch) | |
tree | 2328b6cedb4a82d0de3a8089054e6a7be176073f /block/bio.c | |
parent | ea7d898676d9e94558c46ba927db35403362389f (diff) | |
download | linux-449813515d3e5efec85206bb91588a6249a421a3.tar.gz linux-449813515d3e5efec85206bb91588a6249a421a3.tar.bz2 linux-449813515d3e5efec85206bb91588a6249a421a3.zip |
block, fs: Restore the per-bio/request data lifetime fields
Restore support for passing data lifetime information from filesystems to
block drivers. This patch reverts commit b179c98f7697 ("block: Remove
request.write_hint") and commit c75e707fe1aa ("block: remove the
per-bio/request write hint").
This patch does not modify the size of struct bio because the new
bi_write_hint member fills a hole in struct bio. pahole reports the
following for struct bio on an x86_64 system with this patch applied:
/* size: 112, cachelines: 2, members: 20 */
/* sum members: 110, holes: 1, sum holes: 2 */
/* last cacheline: 48 bytes */
Reviewed-by: Kanchan Joshi <joshi.k@samsung.com>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Christoph Hellwig <hch@lst.de>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Link: https://lore.kernel.org/r/20240202203926.2478590-7-bvanassche@acm.org
Signed-off-by: Christian Brauner <brauner@kernel.org>
Diffstat (limited to 'block/bio.c')
-rw-r--r-- | block/bio.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/block/bio.c b/block/bio.c index b9642a41f286..c9223e9d31da 100644 --- a/block/bio.c +++ b/block/bio.c @@ -251,6 +251,7 @@ void bio_init(struct bio *bio, struct block_device *bdev, struct bio_vec *table, bio->bi_opf = opf; bio->bi_flags = 0; bio->bi_ioprio = 0; + bio->bi_write_hint = 0; bio->bi_status = 0; bio->bi_iter.bi_sector = 0; bio->bi_iter.bi_size = 0; @@ -813,6 +814,7 @@ static int __bio_clone(struct bio *bio, struct bio *bio_src, gfp_t gfp) { bio_set_flag(bio, BIO_CLONED); bio->bi_ioprio = bio_src->bi_ioprio; + bio->bi_write_hint = bio_src->bi_write_hint; bio->bi_iter = bio_src->bi_iter; if (bio->bi_bdev) { |