btree_gc.c (f5faf43f853abb40255059d2b5133699c8528eaa) btree_gc.c (3858aa4268b2f71827097f548879e4405b4cc995)
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Copyright (C) 2010 Kent Overstreet <kent.overstreet@gmail.com>
4 * Copyright (C) 2014 Datera Inc.
5 */
6
7#include "bcachefs.h"
8#include "alloc_background.h"

--- 1243 unchanged lines hidden (view full) ---

1252
1253 if (unlikely(test_bit(BCH_FS_going_ro, &c->flags)))
1254 return -EROFS;
1255
1256 percpu_down_read(&c->mark_lock);
1257 bkey_for_each_ptr(ptrs, ptr) {
1258 struct bch_dev *ca = bch2_dev_bkey_exists(c, ptr->dev);
1259
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Copyright (C) 2010 Kent Overstreet <kent.overstreet@gmail.com>
4 * Copyright (C) 2014 Datera Inc.
5 */
6
7#include "bcachefs.h"
8#include "alloc_background.h"

--- 1243 unchanged lines hidden (view full) ---

1252
1253 if (unlikely(test_bit(BCH_FS_going_ro, &c->flags)))
1254 return -EROFS;
1255
1256 percpu_down_read(&c->mark_lock);
1257 bkey_for_each_ptr(ptrs, ptr) {
1258 struct bch_dev *ca = bch2_dev_bkey_exists(c, ptr->dev);
1259
1260 if (ptr_stale(ca, ptr) > 16) {
1260 if (dev_ptr_stale(ca, ptr) > 16) {
1261 percpu_up_read(&c->mark_lock);
1262 goto update;
1263 }
1264 }
1265
1266 bkey_for_each_ptr(ptrs, ptr) {
1267 struct bch_dev *ca = bch2_dev_bkey_exists(c, ptr->dev);
1268 u8 *gen = &ca->oldest_gen[PTR_BUCKET_NR(ca, ptr)];

--- 140 unchanged lines hidden ---
1261 percpu_up_read(&c->mark_lock);
1262 goto update;
1263 }
1264 }
1265
1266 bkey_for_each_ptr(ptrs, ptr) {
1267 struct bch_dev *ca = bch2_dev_bkey_exists(c, ptr->dev);
1268 u8 *gen = &ca->oldest_gen[PTR_BUCKET_NR(ca, ptr)];

--- 140 unchanged lines hidden ---