From: Linus Torvalds Date: Sat, 26 Mar 2022 18:51:46 +0000 (-0700) Subject: Merge tag 'for-5.18/write-streams-2022-03-18' of git://git.kernel.dk/linux-block X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=561593a048d7d6915889706f4b503a65435c033a;p=linux.git Merge tag 'for-5.18/write-streams-2022-03-18' of git://git.kernel.dk/linux-block Pull NVMe write streams removal from Jens Axboe: "This removes the write streams support in NVMe. No vendor ever really shipped working support for this, and they are not interested in supporting it. With the NVMe support gone, we have nothing in the tree that supports this. Remove passing around of the hints. The only discussion point in this patchset imho is the fact that the file specific write hint setting/getting fcntl helpers will now return -1/EINVAL like they did before we supported write hints. No known applications use these functions, I only know of one prototype that I help do for RocksDB, and that's not used. That said, with a change like this, it's always a bit controversial. Alternatively, we could just make them return 0 and pretend it worked. It's placement based hints after all" * tag 'for-5.18/write-streams-2022-03-18' of git://git.kernel.dk/linux-block: fs: remove fs.f_write_hint fs: remove kiocb.ki_hint block: remove the per-bio/request write hint nvme: remove support or stream based temperature hint --- 561593a048d7d6915889706f4b503a65435c033a diff --cc block/blk-merge.c index 49d0d0da0bf28,0e871d4e7cb8d..7771dacc99cb7 --- a/block/blk-merge.c +++ b/block/blk-merge.c @@@ -754,13 -778,10 +754,6 @@@ static struct request *attempt_merge(st if (rq_data_dir(req) != rq_data_dir(next)) return NULL; - /* - * Don't allow merge of different write hints, or for a hint with - * non-hint IO. - */ - if (req->write_hint != next->write_hint) - if (req_op(req) == REQ_OP_WRITE_SAME && - !blk_write_same_mergeable(req->bio, next->bio)) -- return NULL; -- if (req->ioprio != next->ioprio) return NULL; @@@ -886,13 -903,11 +879,6 @@@ bool blk_rq_merge_ok(struct request *rq if (!bio_crypt_rq_ctx_compatible(rq, bio)) return false; - /* - * Don't allow merge of different write hints, or for a hint with - * non-hint IO. - */ - if (rq->write_hint != bio->bi_write_hint) - /* must be using the same buffer */ - if (req_op(rq) == REQ_OP_WRITE_SAME && - !blk_write_same_mergeable(rq->bio, bio)) -- return false; -- if (rq->ioprio != bio_prio(bio)) return false; diff --cc drivers/md/raid5-ppl.c index ea4cd8dd4dc32,388ab41d1a118..d3962d92df18a --- a/drivers/md/raid5-ppl.c +++ b/drivers/md/raid5-ppl.c @@@ -464,9 -463,10 +464,8 @@@ static void ppl_submit_iounit(struct pp bio->bi_end_io = ppl_log_endio; - bio->bi_opf = REQ_OP_WRITE | REQ_FUA; - bio_set_dev(bio, log->rdev->bdev); bio->bi_iter.bi_sector = log->next_io_sector; bio_add_page(bio, io->header_page, PAGE_SIZE, 0); - bio->bi_write_hint = ppl_conf->write_hint; pr_debug("%s: log->current_io_sector: %llu\n", __func__, (unsigned long long)log->next_io_sector); diff --cc fs/f2fs/file.c index 68ddf4c7ca64e,45076c01a2bab..d3f39a704b8b1 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c @@@ -4514,12 -4509,10 +4512,10 @@@ static ssize_t f2fs_dio_write_iter(stru if (ret) goto out; - down_read(&fi->i_gc_rwsem[WRITE]); + f2fs_down_read(&fi->i_gc_rwsem[WRITE]); if (do_opu) - down_read(&fi->i_gc_rwsem[READ]); + f2fs_down_read(&fi->i_gc_rwsem[READ]); } - if (whint_mode == WHINT_MODE_OFF) - iocb->ki_hint = WRITE_LIFE_NOT_SET; /* * We have to use __iomap_dio_rw() and iomap_dio_complete() instead of @@@ -4542,11 -4535,9 +4538,9 @@@ ret = iomap_dio_complete(dio); } - if (whint_mode == WHINT_MODE_OFF) - iocb->ki_hint = hint; if (do_opu) - up_read(&fi->i_gc_rwsem[READ]); - up_read(&fi->i_gc_rwsem[WRITE]); + f2fs_up_read(&fi->i_gc_rwsem[READ]); + f2fs_up_read(&fi->i_gc_rwsem[WRITE]); if (ret < 0) goto out; diff --cc fs/iomap/direct-io.c index 67cf9c16f80c3,a434b1829545d..b08f5dc31780d --- a/fs/iomap/direct-io.c +++ b/fs/iomap/direct-io.c @@@ -312,10 -308,7 +312,9 @@@ static loff_t iomap_dio_bio_iter(const } bio = bio_alloc(iomap->bdev, nr_pages, bio_opf, GFP_KERNEL); + fscrypt_set_bio_crypt_ctx(bio, inode, pos >> inode->i_blkbits, + GFP_KERNEL); bio->bi_iter.bi_sector = iomap_sector(iomap, pos); - bio->bi_write_hint = dio->iocb->ki_hint; bio->bi_ioprio = dio->iocb->ki_ioprio; bio->bi_private = dio; bio->bi_end_io = iomap_dio_bio_end_io;