aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorAmir Goldstein <amir73il@gmail.com>2018-05-13 22:40:30 -0400
committerBen Hutchings <ben@decadent.org.uk>2018-11-20 18:04:53 +0000
commit1a1c235b391833f0c2fe0a02592f1b8c3d04eaa8 (patch)
tree2d92916749adfe575866f07077bf5b4db7c8379b /include
parent8efefbfda5240e03418c9bdd3b35956eac9619f9 (diff)
downloadlinux-stable-1a1c235b391833f0c2fe0a02592f1b8c3d04eaa8.tar.gz
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>
Diffstat (limited to 'include')
-rw-r--r--include/linux/fs.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 429793382eb649..461e82373ebd64 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -1389,6 +1389,11 @@ static inline void sb_start_intwrite(struct super_block *sb)
__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);