blob: 4a0612eab29d1c107d7d0f907c1aebdb93f4c8b4 [file] [log] [blame]
From: Amir Goldstein <amir73il@gmail.com>
Date: Sun, 13 May 2018 22:40:30 -0400
Subject: vfs: add the sb_start_intwrite_trylock() helper
commit 0c8e3fe35db9b66ae0030849545030ec7c0fc45c upstream.
Needed by ext4 to test frozen fs before updating s_last_mounted.
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
include/linux/fs.h | 5 +++++
1 file changed, 5 insertions(+)
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -1389,6 +1389,11 @@ static inline void sb_start_intwrite(str
__sb_start_write(sb, SB_FREEZE_FS, true);
}
+static inline int sb_start_intwrite_trylock(struct super_block *sb)
+{
+ return __sb_start_write(sb, SB_FREEZE_FS, false);
+}
+
extern bool inode_owner_or_capable(const struct inode *inode);