summaryrefslogtreecommitdiff
path: root/include/linux/fs.h
diff options
context:
space:
mode:
authorAmir Goldstein <amir73il@gmail.com>2018-05-13 22:40:30 -0400
committerTheodore Ts'o <tytso@mit.edu>2018-05-13 22:40:30 -0400
commit0c8e3fe35db9b66ae0030849545030ec7c0fc45c (patch)
tree3edd5f018bd5f2e2a2b635b99eec7a30deff5782 /include/linux/fs.h
parenteee597ac931305eff3d3fd1d61d6aae553bc0984 (diff)
vfs: add the sb_start_intwrite_trylock() helper
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>
Diffstat (limited to 'include/linux/fs.h')
-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 760d8da1b6c7..cac41f1bad05 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -1597,6 +1597,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);