summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Brauner <brauner@kernel.org>2025-11-04 13:12:30 +0100
committerChristian Brauner <brauner@kernel.org>2025-11-05 22:52:15 +0100
commit8e4d576ed3ff917eda65b989ba56b02d9a3894f9 (patch)
tree23a953c383e522d187c2a62a69e6f189c83cfc3a
parent5b8ed52866e3d19e02860c7cf1d6bbbd70b619e9 (diff)
fs: add super_write_guard
Link: https://patch.msgid.link/20251104-work-guards-v1-1-5108ac78a171@kernel.org Reviewed-by: Jan Kara <jack@suse.cz> Signed-off-by: Christian Brauner <brauner@kernel.org>
-rw-r--r--include/linux/fs/super.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/fs/super.h b/include/linux/fs/super.h
index c0d22b12c1c9..b874105743b3 100644
--- a/include/linux/fs/super.h
+++ b/include/linux/fs/super.h
@@ -125,6 +125,11 @@ static inline void sb_start_write(struct super_block *sb)
__sb_start_write(sb, SB_FREEZE_WRITE);
}
+DEFINE_GUARD(super_write,
+ struct super_block *,
+ sb_start_write(_T),
+ sb_end_write(_T))
+
static inline bool sb_start_write_trylock(struct super_block *sb)
{
return __sb_start_write_trylock(sb, SB_FREEZE_WRITE);