From: Amir Goldstein Date: Mon, 14 May 2018 02:40:30 +0000 (-0400) Subject: vfs: add the sb_start_intwrite_trylock() helper X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=0c8e3fe35db9b66ae0030849545030ec7c0fc45c;p=linux.git 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 Signed-off-by: Theodore Ts'o Reviewed-by: Jan Kara --- diff --git a/include/linux/fs.h b/include/linux/fs.h index 760d8da1b6c7d..cac41f1bad052 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);