Thread (23 messages) 23 messages, 7 authors, 2024-10-29

Re: [PATCHv9 4/7] block, fs: add write hint to kiocb

From: Christoph Hellwig <hch@lst.de>
Date: 2024-10-28 11:59:36
Also in: io-uring, linux-fsdevel, linux-nvme, linux-scsi

On Fri, Oct 25, 2024 at 02:36:42PM -0700, Keith Busch wrote:
+static u16 blkdev_write_hint(struct kiocb *iocb, struct block_device *bdev)
+{
+	u16 hint = iocb->ki_write_hint;
+
+	if (!hint)
+		return file_inode(iocb->ki_filp)->i_write_hint;
+
+	if (hint > bdev_max_write_hints(bdev))
+		return file_inode(iocb->ki_filp)->i_write_hint;
+
+	if (bdev_is_partition(bdev) &&
+	    !test_bit(hint - 1, bdev->write_hint_mask))
+		return file_inode(iocb->ki_filp)->i_write_hint;
I would have expected an error when using an invalid stream identifier.

That of course requires telling the application how many are available
through e.g. statx as requested last time.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help