summaryrefslogtreecommitdiff
path: root/fs/bcachefs/bcachefs.h
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2023-09-29 01:15:33 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-22 17:10:16 -0400
commit37fad9497f5d37d89ed06faa64d580d1451be664 (patch)
treed6d54fcf01befddf0534ca915a3bfb60383e1a38 /fs/bcachefs/bcachefs.h
parent1e2d399970ca1d66fa1c715f4d80a0251f2a122e (diff)
downloadlwn-37fad9497f5d37d89ed06faa64d580d1451be664.tar.gz
lwn-37fad9497f5d37d89ed06faa64d580d1451be664.zip
bcachefs: snapshot_create_lock
Add a new lock for snapshot creation - this addresses a few races with logged operations and snapshot deletion. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/bcachefs.h')
-rw-r--r--fs/bcachefs/bcachefs.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/bcachefs/bcachefs.h b/fs/bcachefs/bcachefs.h
index e9d07f9fa1c0..53ffa88cae16 100644
--- a/fs/bcachefs/bcachefs.h
+++ b/fs/bcachefs/bcachefs.h
@@ -746,6 +746,7 @@ struct bch_fs {
struct snapshot_table __rcu *snapshots;
size_t snapshot_table_size;
struct mutex snapshot_table_lock;
+ struct rw_semaphore snapshot_create_lock;
struct work_struct snapshot_delete_work;
struct work_struct snapshot_wait_for_pagecache_and_delete_work;