History

block: add a rq_list type

Replace the semi-open coded request list helpers with a proper rq_list type that mirrors the bio_list and has head and tail pointers. Besides better type safety this actually allows to insert at the tail of the list, which will be useful soon.

Christoph Hellwig committed 2 years ago

Commit a3396b91 parent e8225ab11 files · +104 −88Browse files

Showing the changes to include/linux/blkdev.h (1 of 11 files). Show all

Unified · Split

include/linux/blkdev.h+8−3
@@ -1007,6 +1007,11 @@ extern void blk_put_queue(struct request_queue *); · 1006 unmodified lines
1007void blk_mark_disk_dead(struct gendisk *disk);1007void blk_mark_disk_dead(struct gendisk *disk);
1008 1008
1009#ifdef CONFIG_BLOCK1009#ifdef CONFIG_BLOCK
1010struct rq_list {
1011 struct request *head;
1012 struct request *tail;
1013};
1014
1010/*1015/*
1011 * blk_plug permits building a queue of related requests by holding the I/O1016 * blk_plug permits building a queue of related requests by holding the I/O
1012 * fragments for a short period. This allows merging of sequential requests1017 * fragments for a short period. This allows merging of sequential requests
@@ -1019,10 +1024,10 @@ void blk_mark_disk_dead(struct gendisk *disk); · 6 unmodified lines
1019 * blk_flush_plug() is called.1024 * blk_flush_plug() is called.
1020 */1025 */
1021struct blk_plug {1026struct blk_plug {
1022 struct request *mq_list; /* blk-mq requests */1027 struct rq_list mq_list; /* blk-mq requests */
1023 1028
1024 /* if ios_left is > 1, we can batch tag/rq allocations */1029 /* if ios_left is > 1, we can batch tag/rq allocations */
1025 struct request *cached_rq;1030 struct rq_list cached_rqs;
1026 u64 cur_ktime;1031 u64 cur_ktime;
1027 unsigned short nr_ios;1032 unsigned short nr_ios;
1028 1033
@@ -1684,7 +1689,7 @@ int bdev_thaw(struct block_device *bdev); · 655 unmodified lines
1684void bdev_fput(struct file *bdev_file);1689void bdev_fput(struct file *bdev_file);
1685 1690
1686struct io_comp_batch {1691struct io_comp_batch {
1687 struct request *req_list;1692 struct rq_list req_list;
1688 bool need_ts;1693 bool need_ts;
1689 void (*complete)(struct io_comp_batch *);1694 void (*complete)(struct io_comp_batch *);
1690};1695};

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t