aboutsummaryrefslogtreecommitdiff
path: root/fs/bcachefs/journal_types.h
diff options
context:
space:
mode:
authorGravatar Kent Overstreet <kent.overstreet@gmail.com> 2019-03-03 15:15:55 -0500
committerGravatar Kent Overstreet <kent.overstreet@linux.dev> 2023-10-22 17:08:17 -0400
commit0ce2dbbe9915af85b2ebafe6dfeca6813ba5e13c (patch)
treee1d09ada09543e231381e2dbc42d54fc11e35236 /fs/bcachefs/journal_types.h
parentbcachefs: Allocator startup fixes/refactoring (diff)
downloadlinux-0ce2dbbe9915af85b2ebafe6dfeca6813ba5e13c.tar.gz
linux-0ce2dbbe9915af85b2ebafe6dfeca6813ba5e13c.tar.bz2
linux-0ce2dbbe9915af85b2ebafe6dfeca6813ba5e13c.zip
bcachefs: ja->discard_idx, ja->dirty_idx
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/journal_types.h')
-rw-r--r--fs/bcachefs/journal_types.h24
1 files changed, 11 insertions, 13 deletions
diff --git a/fs/bcachefs/journal_types.h b/fs/bcachefs/journal_types.h
index 2f48008820ac..09b2d2223033 100644
--- a/fs/bcachefs/journal_types.h
+++ b/fs/bcachefs/journal_types.h
@@ -193,9 +193,6 @@ struct journal {
struct journal_entry_pin_list *data;
} pin;
- struct journal_entry_pin *flush_in_progress;
- wait_queue_head_t pin_flush_wait;
-
u64 replay_journal_seq;
struct mutex blacklist_lock;
@@ -206,10 +203,13 @@ struct journal {
spinlock_t err_lock;
struct delayed_work reclaim_work;
+ struct mutex reclaim_lock;
unsigned long last_flushed;
+ struct journal_entry_pin *flush_in_progress;
+ wait_queue_head_t pin_flush_wait;
- /* protects advancing ja->last_idx: */
- struct mutex reclaim_lock;
+ /* protects advancing ja->discard_idx: */
+ struct mutex discard_lock;
unsigned write_delay_ms;
unsigned reclaim_delay_ms;
@@ -240,17 +240,15 @@ struct journal_device {
unsigned sectors_free;
- /* Journal bucket we're currently writing to */
- unsigned cur_idx;
-
- /* Last journal bucket that still contains an open journal entry */
-
/*
- * j->lock and j->reclaim_lock must both be held to modify, j->lock
- * sufficient to read:
+ * discard_idx <= dirty_idx_ondisk <= dirty_idx <= cur_idx:
*/
- unsigned last_idx;
+ unsigned discard_idx; /* Next bucket to discard */
+ unsigned dirty_idx_ondisk;
+ unsigned dirty_idx;
+ unsigned cur_idx; /* Journal bucket we're currently writing to */
unsigned nr;
+
u64 *buckets;
/* Bio for journal reads/writes to this device */