From: David Howells <dhowells@redhat.com>
Date: Mon, 17 Jul 2017 07:45:34 +0000 (+0100)
Subject: vfs: Add sb_rdonly(sb) to query the MS_RDONLY flag on s_flags
X-Git-Tag: v4.14-rc1~19^2~2
X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=94e92e7ac90d06e1e839e112d3ae80b2457dbdd7;p=users%2Fwilly%2Flinux.git

vfs: Add sb_rdonly(sb) to query the MS_RDONLY flag on s_flags

Add an sb_rdonly() function to query the MS_RDONLY flag on sb->s_flags
preparatory to providing an SB_RDONLY flag.

Signed-off-by: David Howells <dhowells@redhat.com>
---

diff --git a/include/linux/fs.h b/include/linux/fs.h
index 7b5d6816542b..6ae137c1bdf6 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -1844,7 +1844,8 @@ struct super_operations {
  */
 #define __IS_FLG(inode, flg)	((inode)->i_sb->s_flags & (flg))
 
-#define IS_RDONLY(inode)	((inode)->i_sb->s_flags & MS_RDONLY)
+static inline bool sb_rdonly(const struct super_block *sb) { return sb->s_flags & MS_RDONLY; }
+#define IS_RDONLY(inode)	sb_rdonly((inode)->i_sb)
 #define IS_SYNC(inode)		(__IS_FLG(inode, MS_SYNCHRONOUS) || \
 					((inode)->i_flags & S_SYNC))
 #define IS_DIRSYNC(inode)	(__IS_FLG(inode, MS_SYNCHRONOUS|MS_DIRSYNC) || \