]> git.sesse.net Git - bcachefs-tools-debian/blob - libbcachefs/nocow_locking.c
Update bcachefs sources to 5963d1b1a4 bcacehfs: Fix bch2_get_alloc_in_memory_pos()
[bcachefs-tools-debian] / libbcachefs / nocow_locking.c
1 // SPDX-License-Identifier: GPL-2.0
2
3 #include "bcachefs.h"
4 #include "nocow_locking.h"
5 #include "util.h"
6
7 void __bch2_bucket_nocow_lock(struct bucket_nocow_lock_table *t,
8                               two_state_lock_t *l, int flags)
9 {
10         struct bch_fs *c = container_of(t, struct bch_fs, nocow_locks);
11         u64 start_time = local_clock();
12
13         __bch2_two_state_lock(l, flags & BUCKET_NOCOW_LOCK_UPDATE);
14         bch2_time_stats_update(&c->times[BCH_TIME_nocow_lock_contended], start_time);
15 }