add patch forbid-overflowing-inode-code-when-resizing
[ext4-patch-queue.git] / add-the-sb_start_intwrite_trylock-helper
blob3fc27df4d0831eb67bebdaea581eae9007feb585
1 vfs: add the sb_start_intwrite_trylock() helper
3 From: Amir Goldstein <amir73il@gmail.com>
5 Needed by ext4 to test frozen fs before updating s_last_mounted.
7 Signed-off-by: Amir Goldstein <amir73il@gmail.com>
8 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
9 Reviewed-by: Jan Kara <jack@suse.cz>
10 ---
11  include/linux/fs.h | 5 +++++
12  1 file changed, 5 insertions(+)
14 diff --git a/include/linux/fs.h b/include/linux/fs.h
15 index 760d8da1b6c7..cac41f1bad05 100644
16 --- a/include/linux/fs.h
17 +++ b/include/linux/fs.h
18 @@ -1597,6 +1597,11 @@ static inline void sb_start_intwrite(struct super_block *sb)
19         __sb_start_write(sb, SB_FREEZE_FS, true);
20  }
22 +static inline int sb_start_intwrite_trylock(struct super_block *sb)
24 +       return __sb_start_write(sb, SB_FREEZE_FS, false);
28  extern bool inode_owner_or_capable(const struct inode *inode);
30 -- 
31 2.7.4