Merge tag 'for-5.18/write-streams-2022-03-18' of git://git.kernel.dk/linux-block
authorLinus Torvalds <torvalds@linux-foundation.org>
Sat, 26 Mar 2022 18:51:46 +0000 (11:51 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 26 Mar 2022 18:51:46 +0000 (11:51 -0700)
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

24 files changed:
1  2 
block/bio.c
block/blk-merge.c
block/blk-mq-debugfs.c
block/blk-mq.c
block/bounce.c
block/fops.c
drivers/md/raid1.c
drivers/md/raid5-ppl.c
drivers/md/raid5.c
drivers/nvme/host/core.c
drivers/nvme/host/nvme.h
fs/aio.c
fs/btrfs/extent_io.c
fs/buffer.c
fs/f2fs/data.c
fs/f2fs/file.c
fs/io_uring.c
fs/iomap/buffered-io.c
fs/iomap/direct-io.c
fs/mpage.c
fs/zonefs/super.c
include/linux/blk_types.h
include/linux/blkdev.h
include/linux/fs.h

diff --cc block/bio.c
Simple merge
index 49d0d0da0bf2839fa16c9ecbd6f152f561bd308a,0e871d4e7cb8dfe3c761cc73a3d20922ad0bf94f..7771dacc99cb7d30328b277ac6866c8b2bf39f44
@@@ -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;
  
Simple merge
diff --cc block/blk-mq.c
Simple merge
diff --cc block/bounce.c
Simple merge
diff --cc block/fops.c
Simple merge
Simple merge
index ea4cd8dd4dc322a5ca1650ec1be91e6837444fc6,388ab41d1a1185f0537a37c4d49af1e632568844..d3962d92df18a02b2531340901227a7d9a14ef04
@@@ -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);
Simple merge
Simple merge
Simple merge
diff --cc fs/aio.c
Simple merge
Simple merge
diff --cc fs/buffer.c
Simple merge
diff --cc fs/f2fs/data.c
Simple merge
diff --cc fs/f2fs/file.c
index 68ddf4c7ca64e1fc5cac799d24ab3a9ab8681205,45076c01a2bab50ab84264043b9051ac2bd836d7..d3f39a704b8b1d6a4fec20ee0d78c4b0e404c45f
@@@ -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
                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/io_uring.c
Simple merge
Simple merge
index 67cf9c16f80c3fedf2d4e14983f176a741c779cb,a434b1829545d97094a25d0f58d0366cb9fd7207..b08f5dc31780da7ae5288c711ce09328a60f46bc
@@@ -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;
diff --cc fs/mpage.c
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge