aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2012-10-15 11:40:35 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2012-10-16 13:36:58 -0400
commitbbc1096ad8e9875a025bbcf012605da49129e8b8 (patch)
tree2d236fde4d4198164fa6d07bf53d04c8a10a8a11 /include/linux
parent45525b26a46cd593cb72070304c4cd7c8391bd37 (diff)
Unexport some bits of linux/fs.h
There are some bits of linux/fs.h which are only used within the kernel and shouldn't be in the UAPI. Move these from uapi/linux/fs.h into linux/fs.h. Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/fs.h130
1 files changed, 130 insertions, 0 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 001c7cff2d48..8b53931b5a74 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -64,6 +64,77 @@ typedef void (dio_iodone_t)(struct kiocb *iocb, loff_t offset,
64 ssize_t bytes, void *private, int ret, 64 ssize_t bytes, void *private, int ret,
65 bool is_async); 65 bool is_async);
66 66
67#define MAY_EXEC 0x00000001
68#define MAY_WRITE 0x00000002
69#define MAY_READ 0x00000004
70#define MAY_APPEND 0x00000008
71#define MAY_ACCESS 0x00000010
72#define MAY_OPEN 0x00000020
73#define MAY_CHDIR 0x00000040
74/* called from RCU mode, don't block */
75#define MAY_NOT_BLOCK 0x00000080
76
77/*
78 * flags in file.f_mode. Note that FMODE_READ and FMODE_WRITE must correspond
79 * to O_WRONLY and O_RDWR via the strange trick in __dentry_open()
80 */
81
82/* file is open for reading */
83#define FMODE_READ ((__force fmode_t)0x1)
84/* file is open for writing */
85#define FMODE_WRITE ((__force fmode_t)0x2)
86/* file is seekable */
87#define FMODE_LSEEK ((__force fmode_t)0x4)
88/* file can be accessed using pread */
89#define FMODE_PREAD ((__force fmode_t)0x8)
90/* file can be accessed using pwrite */
91#define FMODE_PWRITE ((__force fmode_t)0x10)
92/* File is opened for execution with sys_execve / sys_uselib */
93#define FMODE_EXEC ((__force fmode_t)0x20)
94/* File is opened with O_NDELAY (only set for block devices) */
95#define FMODE_NDELAY ((__force fmode_t)0x40)
96/* File is opened with O_EXCL (only set for block devices) */
97#define FMODE_EXCL ((__force fmode_t)0x80)
98/* File is opened using open(.., 3, ..) and is writeable only for ioctls
99 (specialy hack for floppy.c) */
100#define FMODE_WRITE_IOCTL ((__force fmode_t)0x100)
101/* 32bit hashes as llseek() offset (for directories) */
102#define FMODE_32BITHASH ((__force fmode_t)0x200)
103/* 64bit hashes as llseek() offset (for directories) */
104#define FMODE_64BITHASH ((__force fmode_t)0x400)
105
106/*
107 * Don't update ctime and mtime.
108 *
109 * Currently a special hack for the XFS open_by_handle ioctl, but we'll
110 * hopefully graduate it to a proper O_CMTIME flag supported by open(2) soon.
111 */
112#define FMODE_NOCMTIME ((__force fmode_t)0x800)
113
114/* Expect random access pattern */
115#define FMODE_RANDOM ((__force fmode_t)0x1000)
116
117/* File is huge (eg. /dev/kmem): treat loff_t as unsigned */
118#define FMODE_UNSIGNED_OFFSET ((__force fmode_t)0x2000)
119
120/* File is opened with O_PATH; almost nothing can be done with it */
121#define FMODE_PATH ((__force fmode_t)0x4000)
122
123/* File was opened by fanotify and shouldn't generate fanotify events */
124#define FMODE_NONOTIFY ((__force fmode_t)0x1000000)
125
126/*
127 * Flag for rw_copy_check_uvector and compat_rw_copy_check_uvector
128 * that indicates that they should check the contents of the iovec are
129 * valid, but not check the memory that the iovec elements
130 * points too.
131 */
132#define CHECK_IOVEC_ONLY -1
133
134#define SEL_IN 1
135#define SEL_OUT 2
136#define SEL_EX 4
137
67/* 138/*
68 * The below are the various read and write types that we support. Some of 139 * The below are the various read and write types that we support. Some of
69 * them include behavioral modifiers that send information down to the 140 * them include behavioral modifiers that send information down to the
@@ -1557,6 +1628,60 @@ struct super_operations {
1557}; 1628};
1558 1629
1559/* 1630/*
1631 * Inode flags - they have no relation to superblock flags now
1632 */
1633#define S_SYNC 1 /* Writes are synced at once */
1634#define S_NOATIME 2 /* Do not update access times */
1635#define S_APPEND 4 /* Append-only file */
1636#define S_IMMUTABLE 8 /* Immutable file */
1637#define S_DEAD 16 /* removed, but still open directory */
1638#define S_NOQUOTA 32 /* Inode is not counted to quota */
1639#define S_DIRSYNC 64 /* Directory modifications are synchronous */
1640#define S_NOCMTIME 128 /* Do not update file c/mtime */
1641#define S_SWAPFILE 256 /* Do not truncate: swapon got its bmaps */
1642#define S_PRIVATE 512 /* Inode is fs-internal */
1643#define S_IMA 1024 /* Inode has an associated IMA struct */
1644#define S_AUTOMOUNT 2048 /* Automount/referral quasi-directory */
1645#define S_NOSEC 4096 /* no suid or xattr security attributes */
1646
1647/*
1648 * Note that nosuid etc flags are inode-specific: setting some file-system
1649 * flags just means all the inodes inherit those flags by default. It might be
1650 * possible to override it selectively if you really wanted to with some
1651 * ioctl() that is not currently implemented.
1652 *
1653 * Exception: MS_RDONLY is always applied to the entire file system.
1654 *
1655 * Unfortunately, it is possible to change a filesystems flags with it mounted
1656 * with files in use. This means that all of the inodes will not have their
1657 * i_flags updated. Hence, i_flags no longer inherit the superblock mount
1658 * flags, so these have to be checked separately. -- rmk@arm.uk.linux.org
1659 */
1660#define __IS_FLG(inode, flg) ((inode)->i_sb->s_flags & (flg))
1661
1662#define IS_RDONLY(inode) ((inode)->i_sb->s_flags & MS_RDONLY)
1663#define IS_SYNC(inode) (__IS_FLG(inode, MS_SYNCHRONOUS) || \
1664 ((inode)->i_flags & S_SYNC))
1665#define IS_DIRSYNC(inode) (__IS_FLG(inode, MS_SYNCHRONOUS|MS_DIRSYNC) || \
1666 ((inode)->i_flags & (S_SYNC|S_DIRSYNC)))
1667#define IS_MANDLOCK(inode) __IS_FLG(inode, MS_MANDLOCK)
1668#define IS_NOATIME(inode) __IS_FLG(inode, MS_RDONLY|MS_NOATIME)
1669#define IS_I_VERSION(inode) __IS_FLG(inode, MS_I_VERSION)
1670
1671#define IS_NOQUOTA(inode) ((inode)->i_flags & S_NOQUOTA)
1672#define IS_APPEND(inode) ((inode)->i_flags & S_APPEND)
1673#define IS_IMMUTABLE(inode) ((inode)->i_flags & S_IMMUTABLE)
1674#define IS_POSIXACL(inode) __IS_FLG(inode, MS_POSIXACL)
1675
1676#define IS_DEADDIR(inode) ((inode)->i_flags & S_DEAD)
1677#define IS_NOCMTIME(inode) ((inode)->i_flags & S_NOCMTIME)
1678#define IS_SWAPFILE(inode) ((inode)->i_flags & S_SWAPFILE)
1679#define IS_PRIVATE(inode) ((inode)->i_flags & S_PRIVATE)
1680#define IS_IMA(inode) ((inode)->i_flags & S_IMA)
1681#define IS_AUTOMOUNT(inode) ((inode)->i_flags & S_AUTOMOUNT)
1682#define IS_NOSEC(inode) ((inode)->i_flags & S_NOSEC)
1683
1684/*
1560 * Inode state bits. Protected by inode->i_lock 1685 * Inode state bits. Protected by inode->i_lock
1561 * 1686 *
1562 * Three bits determine the dirty state of the inode, I_DIRTY_SYNC, 1687 * Three bits determine the dirty state of the inode, I_DIRTY_SYNC,
@@ -1688,6 +1813,11 @@ int sync_inode_metadata(struct inode *inode, int wait);
1688struct file_system_type { 1813struct file_system_type {
1689 const char *name; 1814 const char *name;
1690 int fs_flags; 1815 int fs_flags;
1816#define FS_REQUIRES_DEV 1
1817#define FS_BINARY_MOUNTDATA 2
1818#define FS_HAS_SUBTYPE 4
1819#define FS_REVAL_DOT 16384 /* Check the paths ".", ".." for staleness */
1820#define FS_RENAME_DOES_D_MOVE 32768 /* FS will handle d_move() during rename() internally. */
1691 struct dentry *(*mount) (struct file_system_type *, int, 1821 struct dentry *(*mount) (struct file_system_type *, int,
1692 const char *, void *); 1822 const char *, void *);
1693 void (*kill_sb) (struct super_block *); 1823 void (*kill_sb) (struct super_block *);