summaryrefslogtreecommitdiff
path: root/libbcachefs/alloc_background.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2022-04-11 22:40:16 -0400
committerKent Overstreet <kent.overstreet@gmail.com>2022-04-11 22:40:16 -0400
commit04ad4ade4c42aa716eae5ec12ba577eda4ab055e (patch)
tree4c57c6223e37885634d2672506a4eae80d69b555 /libbcachefs/alloc_background.c
parent7923c2ee0616ef35d984e292dd9e799babe96662 (diff)
Update bcachefs sources to fb8a27f6d4 bcachefs: Delete a redundant tracepoint
Diffstat (limited to 'libbcachefs/alloc_background.c')
-rw-r--r--libbcachefs/alloc_background.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/libbcachefs/alloc_background.c b/libbcachefs/alloc_background.c
index a44d93b..7be4829 100644
--- a/libbcachefs/alloc_background.c
+++ b/libbcachefs/alloc_background.c
@@ -545,6 +545,7 @@ int bch2_trans_mark_alloc(struct btree_trans *trans,
{
struct bch_fs *c = trans->c;
struct bch_alloc_v4 old_a, *new_a;
+ u64 old_lru, new_lru;
int ret = 0;
/*
@@ -586,13 +587,13 @@ int bch2_trans_mark_alloc(struct btree_trans *trans,
!new_a->io_time[READ])
new_a->io_time[READ] = max_t(u64, 1, atomic64_read(&c->io_clock[READ].now));
- if ((old_a.data_type == BCH_DATA_cached) !=
- (new_a->data_type == BCH_DATA_cached)) {
- u64 old_lru = alloc_lru_idx(old_a);
- u64 new_lru = alloc_lru_idx(*new_a);
+ old_lru = alloc_lru_idx(old_a);
+ new_lru = alloc_lru_idx(*new_a);
+
+ if (old_lru != new_lru) {
ret = bch2_lru_change(trans, new->k.p.inode, new->k.p.offset,
- old_lru, &new_lru);
+ old_lru, &new_lru, old);
if (ret)
return ret;