summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorChristian Brauner <brauner@kernel.org>2025-11-05 09:37:47 +0100
committerChristian Brauner <brauner@kernel.org>2025-11-05 22:59:31 +0100
commit73fd0dba0beb1d2d1695ee5452eac8dfabce3f9e (patch)
tree282072941bb3b6e6498d8e7b37d3cbbd99f0a9f7 /include/linux
parent5b8ed52866e3d19e02860c7cf1d6bbbd70b619e9 (diff)
parentab5f296076f3cd43470e2f70db61c9fd258db85b (diff)
Merge patch series "fs: introduce super write guard"
Christian Brauner <brauner@kernel.org> says: I'm in the process of adding a few more guards for vfs constructs. I've chosen the easy case of super_start_write() and super_end_write() and converted eligible callers. I think long-term we can move a lot of the manual placement to completely rely on guards - where sensible. * patches from https://patch.msgid.link/20251104-work-guards-v1-0-5108ac78a171@kernel.org: xfs: use super write guard in xfs_file_ioctl() open: use super write guard in do_ftruncate() btrfs: use super write guard in relocating_repair_kthread() ext4: use super write guard in write_mmp_block() btrfs: use super write guard in sb_start_write() btrfs: use super write guard btrfs_run_defrag_inode() btrfs: use super write guard in btrfs_reclaim_bgs_work() fs: add super_write_guard Link: https://patch.msgid.link/20251104-work-guards-v1-0-5108ac78a171@kernel.org Signed-off-by: Christian Brauner <brauner@kernel.org>
Diffstat (limited to 'include/linux')
-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);