summaryrefslogtreecommitdiffstats
path: root/include/linux/pktcdvd.h
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2021-12-09 21:31:56 -0700
committerJens Axboe <axboe@kernel.dk>2021-12-09 21:31:56 -0700
commitdb67097aa6f2587b44055f2e16db72a11e17faef (patch)
treeee0b64573e4628a8eb9a9011812af94fc42d5b14 /include/linux/pktcdvd.h
parent2385ebf38f94d4f7761b1e9a4973d04753da02c2 (diff)
downloadlinux-db67097aa6f2587b44055f2e16db72a11e17faef.tar.gz
linux-db67097aa6f2587b44055f2e16db72a11e17faef.tar.bz2
linux-db67097aa6f2587b44055f2e16db72a11e17faef.zip
pktdvd: stop using bdi congestion framework.
The bdi congestion framework isn't widely used and should be deprecated. pktdvd makes use of it to track congestion, but this can be done entirely internally to pktdvd, so it doesn't need to use the framework. So introduce a "congested" flag. When waiting for bio_queue_size to drop, set this flag and a var_waitqueue() to wait for it. When bio_queue_size does drop and this flag is set, clear the flag and call wake_up_var(). We don't use a wait_var_event macro for the waiting as we need to set the flag and drop the spinlock before calling schedule() and while that is possible with __wait_var_event(), result is not easy to read. Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: NeilBrown <neilb@suse.de> Link: https://lore.kernel.org/r/163910843527.9928.857338663717630212@noble.neil.brown.name Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'include/linux/pktcdvd.h')
-rw-r--r--include/linux/pktcdvd.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/pktcdvd.h b/include/linux/pktcdvd.h
index 174601554b06..c391e694aa26 100644
--- a/include/linux/pktcdvd.h
+++ b/include/linux/pktcdvd.h
@@ -183,6 +183,8 @@ struct pktcdvd_device
spinlock_t lock; /* Serialize access to bio_queue */
struct rb_root bio_queue; /* Work queue of bios we need to handle */
int bio_queue_size; /* Number of nodes in bio_queue */
+ bool congested; /* Someone is waiting for bio_queue_size
+ * to drop. */
sector_t current_sector; /* Keep track of where the elevator is */
atomic_t scan_queue; /* Set to non-zero when pkt_handle_queue */
/* needs to be run. */