summaryrefslogtreecommitdiffstats
path: root/include/linux/fs.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/fs.h')
-rw-r--r--include/linux/fs.h48
1 files changed, 38 insertions, 10 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 6e187cba94c3..b4ae080f41a6 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -1271,6 +1271,33 @@ extern pid_t f_getown(struct file *filp);
1271extern int send_sigurg(struct fown_struct *fown); 1271extern int send_sigurg(struct fown_struct *fown);
1272 1272
1273/* 1273/*
1274 * sb->s_flags. Note that these mirror the equivalent MS_* flags where
1275 * represented in both.
1276 */
1277#define SB_RDONLY 1 /* Mount read-only */
1278#define SB_NOSUID 2 /* Ignore suid and sgid bits */
1279#define SB_NODEV 4 /* Disallow access to device special files */
1280#define SB_NOEXEC 8 /* Disallow program execution */
1281#define SB_SYNCHRONOUS 16 /* Writes are synced at once */
1282#define SB_MANDLOCK 64 /* Allow mandatory locks on an FS */
1283#define SB_DIRSYNC 128 /* Directory modifications are synchronous */
1284#define SB_NOATIME 1024 /* Do not update access times. */
1285#define SB_NODIRATIME 2048 /* Do not update directory access times */
1286#define SB_SILENT 32768
1287#define SB_POSIXACL (1<<16) /* VFS does not apply the umask */
1288#define SB_KERNMOUNT (1<<22) /* this is a kern_mount call */
1289#define SB_I_VERSION (1<<23) /* Update inode I_version field */
1290#define SB_LAZYTIME (1<<25) /* Update the on-disk [acm]times lazily */
1291
1292/* These sb flags are internal to the kernel */
1293#define SB_SUBMOUNT (1<<26)
1294#define SB_NOREMOTELOCK (1<<27)
1295#define SB_NOSEC (1<<28)
1296#define SB_BORN (1<<29)
1297#define SB_ACTIVE (1<<30)
1298#define SB_NOUSER (1<<31)
1299
1300/*
1274 * Umount options 1301 * Umount options
1275 */ 1302 */
1276 1303
@@ -1833,7 +1860,7 @@ struct super_operations {
1833 * possible to override it selectively if you really wanted to with some 1860 * possible to override it selectively if you really wanted to with some
1834 * ioctl() that is not currently implemented. 1861 * ioctl() that is not currently implemented.
1835 * 1862 *
1836 * Exception: MS_RDONLY is always applied to the entire file system. 1863 * Exception: SB_RDONLY is always applied to the entire file system.
1837 * 1864 *
1838 * Unfortunately, it is possible to change a filesystems flags with it mounted 1865 * Unfortunately, it is possible to change a filesystems flags with it mounted
1839 * with files in use. This means that all of the inodes will not have their 1866 * with files in use. This means that all of the inodes will not have their
@@ -1842,19 +1869,20 @@ struct super_operations {
1842 */ 1869 */
1843#define __IS_FLG(inode, flg) ((inode)->i_sb->s_flags & (flg)) 1870#define __IS_FLG(inode, flg) ((inode)->i_sb->s_flags & (flg))
1844 1871
1845#define IS_RDONLY(inode) ((inode)->i_sb->s_flags & MS_RDONLY) 1872static inline bool sb_rdonly(const struct super_block *sb) { return sb->s_flags & MS_RDONLY; }
1846#define IS_SYNC(inode) (__IS_FLG(inode, MS_SYNCHRONOUS) || \ 1873#define IS_RDONLY(inode) sb_rdonly((inode)->i_sb)
1874#define IS_SYNC(inode) (__IS_FLG(inode, SB_SYNCHRONOUS) || \
1847 ((inode)->i_flags & S_SYNC)) 1875 ((inode)->i_flags & S_SYNC))
1848#define IS_DIRSYNC(inode) (__IS_FLG(inode, MS_SYNCHRONOUS|MS_DIRSYNC) || \ 1876#define IS_DIRSYNC(inode) (__IS_FLG(inode, SB_SYNCHRONOUS|SB_DIRSYNC) || \
1849 ((inode)->i_flags & (S_SYNC|S_DIRSYNC))) 1877 ((inode)->i_flags & (S_SYNC|S_DIRSYNC)))
1850#define IS_MANDLOCK(inode) __IS_FLG(inode, MS_MANDLOCK) 1878#define IS_MANDLOCK(inode) __IS_FLG(inode, SB_MANDLOCK)
1851#define IS_NOATIME(inode) __IS_FLG(inode, MS_RDONLY|MS_NOATIME) 1879#define IS_NOATIME(inode) __IS_FLG(inode, SB_RDONLY|SB_NOATIME)
1852#define IS_I_VERSION(inode) __IS_FLG(inode, MS_I_VERSION) 1880#define IS_I_VERSION(inode) __IS_FLG(inode, SB_I_VERSION)
1853 1881
1854#define IS_NOQUOTA(inode) ((inode)->i_flags & S_NOQUOTA) 1882#define IS_NOQUOTA(inode) ((inode)->i_flags & S_NOQUOTA)
1855#define IS_APPEND(inode) ((inode)->i_flags & S_APPEND) 1883#define IS_APPEND(inode) ((inode)->i_flags & S_APPEND)
1856#define IS_IMMUTABLE(inode) ((inode)->i_flags & S_IMMUTABLE) 1884#define IS_IMMUTABLE(inode) ((inode)->i_flags & S_IMMUTABLE)
1857#define IS_POSIXACL(inode) __IS_FLG(inode, MS_POSIXACL) 1885#define IS_POSIXACL(inode) __IS_FLG(inode, SB_POSIXACL)
1858 1886
1859#define IS_DEADDIR(inode) ((inode)->i_flags & S_DEAD) 1887#define IS_DEADDIR(inode) ((inode)->i_flags & S_DEAD)
1860#define IS_NOCMTIME(inode) ((inode)->i_flags & S_NOCMTIME) 1888#define IS_NOCMTIME(inode) ((inode)->i_flags & S_NOCMTIME)
@@ -2175,7 +2203,7 @@ static inline int __mandatory_lock(struct inode *ino)
2175} 2203}
2176 2204
2177/* 2205/*
2178 * ... and these candidates should be on MS_MANDLOCK mounted fs, 2206 * ... and these candidates should be on SB_MANDLOCK mounted fs,
2179 * otherwise these will be advisory locks 2207 * otherwise these will be advisory locks
2180 */ 2208 */
2181 2209
@@ -3291,7 +3319,7 @@ static inline int check_sticky(struct inode *dir, struct inode *inode)
3291 3319
3292static inline void inode_has_no_xattr(struct inode *inode) 3320static inline void inode_has_no_xattr(struct inode *inode)
3293{ 3321{
3294 if (!is_sxid(inode->i_mode) && (inode->i_sb->s_flags & MS_NOSEC)) 3322 if (!is_sxid(inode->i_mode) && (inode->i_sb->s_flags & SB_NOSEC))
3295 inode->i_flags |= S_NOSEC; 3323 inode->i_flags |= S_NOSEC;
3296} 3324}
3297 3325