ANDROID: block: Restore request_queue.requeue_work

Restore the struct request_queue requeue_work member without modifying
the KMI. The approach of this patch works because blk_dev_init() is the
only function that needs to know the size of a request queue structure.

This patch prepares for reverting "Preserve the order of requeued
requests".

See also commit 619ba336c3 ("ANDROID: block: Remove
request_queue.requeue_work").

Bug: 298142254
Change-Id: I108ceb9f58cec521f81fd8cf82f38185376a7a6b
Signed-off-by: Bart Van Assche <bvanassche@google.com>
This commit is contained in:
Bart Van Assche
2023-09-18 10:47:39 -07:00
parent cfe32cb3c3
commit 1988ebab8f
2 changed files with 12 additions and 1 deletions

View File

@@ -1789,7 +1789,7 @@ int __init blk_dev_init(void)
panic("Failed to create kblockd\n");
blk_requestq_cachep = kmem_cache_create("request_queue",
sizeof(struct request_queue), 0, SLAB_PANIC, NULL);
sizeof(struct internal_request_queue), 0, SLAB_PANIC, NULL);
blk_debugfs_root = debugfs_create_dir("block", NULL);

View File

@@ -17,6 +17,17 @@
extern struct dentry *blk_debugfs_root;
struct internal_request_queue {
struct request_queue q;
struct delayed_work requeue_work;
};
static inline struct internal_request_queue *
to_internal_q(struct request_queue *q)
{
return container_of(q, struct internal_request_queue, q);
}
struct blk_flush_queue {
unsigned int flush_pending_idx:1;
unsigned int flush_running_idx:1;