diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2018-11-19 09:16:07 +0300 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-23 00:08:12 +0300 |
commit | 8eb7f3ee46f23207d3e0ae6428b780a0708c53c1 (patch) | |
tree | cc16478b996ec1fd0f3d9ef778e526f3c501ec17 /fs/bcachefs/buckets.h | |
parent | 90541a741d74373b8cca2bcd56c469927d093064 (diff) | |
download | linux-8eb7f3ee46f23207d3e0ae6428b780a0708c53c1.tar.xz |
bcachefs: move dirty into bucket_mark
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/buckets.h')
-rw-r--r-- | fs/bcachefs/buckets.h | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/fs/bcachefs/buckets.h b/fs/bcachefs/buckets.h index c584ad1b4375..d34181c78f9b 100644 --- a/fs/bcachefs/buckets.h +++ b/fs/bcachefs/buckets.h @@ -57,6 +57,18 @@ static inline struct bucket *bucket(struct bch_dev *ca, size_t b) return __bucket(ca, b, false); } +static inline void bucket_set_dirty(struct bch_dev *ca, size_t b) +{ + struct bucket *g; + struct bucket_mark m; + + rcu_read_lock(); + g = bucket(ca, b); + bucket_cmpxchg(g, m, m.dirty = true); + rcu_read_unlock(); + +} + static inline void bucket_io_clock_reset(struct bch_fs *c, struct bch_dev *ca, size_t b, int rw) { @@ -196,8 +208,7 @@ static inline bool is_available_bucket(struct bucket_mark mark) { return (!mark.owned_by_allocator && !mark.dirty_sectors && - !mark.stripe && - !mark.nouse); + !mark.stripe); } static inline bool bucket_needs_journal_commit(struct bucket_mark m, |