Add an explanation for the flags used by FS_IOC_[GS]ETFLAGS and remind people that changes should be revised by linux-fsdevel and linux-api. Add flags that are used on-disk for ext4, and remove FS_DIRECTIO_FL since it was used only by gfs2 and support was removed in 2008 in commit c9f6a6bbc28 ("The ability to mark files for direct i/o access when opened normally is both unused and pointless, so this patch removes support for that feature.") Now we have _two_ remaining flags left. But since we want to discourage people from assigning new flags, that's OK.
Unified · Split
| @@ -2,8 +2,11 @@ · 1 unmodified line | |||
| 2 | #define _UAPI_LINUX_FS_H | 2 | #define _UAPI_LINUX_FS_H |
| 3 | 3 | ||
| 4 | /* | 4 | /* |
| 5 | * This file has definitions for some important file table | 5 | * This file has definitions for some important file table structures |
| 6 | * structures etc. | 6 | * and constants and structures used by various generic file system |
| 7 | * ioctl's. Please do not make any changes in this file before | ||
| 8 | * sending patches for review to linux-fsdevel@vger.kernel.org and | ||
| 9 | * linux-api@vger.kernel.org. | ||
| 7 | */ | 10 | */ |
| 8 | 11 | ||
| 9 | #include <linux/limits.h> | 12 | #include <linux/limits.h> |
| @@ -172,6 +175,23 @@ struct inodes_stat_t { · 162 unmodified lines | |||
| 172 | 175 | ||
| 173 | /* | 176 | /* |
| 174 | * Inode flags (FS_IOC_GETFLAGS / FS_IOC_SETFLAGS) | 177 | * Inode flags (FS_IOC_GETFLAGS / FS_IOC_SETFLAGS) |
| 178 | * | ||
| 179 | * Note: for historical reasons, these flags were originally used and | ||
| 180 | * defined for use by ext2/ext3, and then other file systems started | ||
| 181 | * using these flags so they wouldn't need to write their own version | ||
| 182 | * of chattr/lsattr (which was shipped as part of e2fsprogs). You | ||
| 183 | * should think twice before trying to use these flags in new | ||
| 184 | * contexts, or trying to assign these flags, since they are used both | ||
| 185 | * as the UAPI and the on-disk encoding for ext2/3/4. Also, we are | ||
| 186 | * almost out of 32-bit flags. :-) | ||
| 187 | * | ||
| 188 | * We have recently hoisted FS_IOC_FSGETXATTR / FS_IOC_FSSETXATTR from | ||
| 189 | * XFS to the generic FS level interface. This uses a structure that | ||
| 190 | * has padding and hence has more room to grow, so it may be more | ||
| 191 | * appropriate for many new use cases. | ||
| 192 | * | ||
| 193 | * Please do not change these flags or interfaces before checking with | ||
| 194 | * linux-fsdevel@vger.kernel.org and linux-api@vger.kernel.org. | ||
| 175 | */ | 195 | */ |
| 176 | #define FS_SECRM_FL 0x00000001 /* Secure deletion */ | 196 | #define FS_SECRM_FL 0x00000001 /* Secure deletion */ |
| 177 | #define FS_UNRM_FL 0x00000002 /* Undelete */ | 197 | #define FS_UNRM_FL 0x00000002 /* Undelete */ |
| @@ -185,8 +205,8 @@ struct inodes_stat_t { · 7 unmodified lines | |||
| 185 | #define FS_DIRTY_FL 0x00000100 | 205 | #define FS_DIRTY_FL 0x00000100 |
| 186 | #define FS_COMPRBLK_FL 0x00000200 /* One or more compressed clusters */ | 206 | #define FS_COMPRBLK_FL 0x00000200 /* One or more compressed clusters */ |
| 187 | #define FS_NOCOMP_FL 0x00000400 /* Don't compress */ | 207 | #define FS_NOCOMP_FL 0x00000400 /* Don't compress */ |
| 188 | #define FS_ECOMPR_FL 0x00000800 /* Compression error */ | ||
| 189 | /* End compression flags --- maybe not all used */ | 208 | /* End compression flags --- maybe not all used */ |
| 209 | #define FS_ENCRYPT_FL 0x00000800 /* Encrypted file */ | ||
| 190 | #define FS_BTREE_FL 0x00001000 /* btree format dir */ | 210 | #define FS_BTREE_FL 0x00001000 /* btree format dir */ |
| 191 | #define FS_INDEX_FL 0x00001000 /* hash-indexed directory */ | 211 | #define FS_INDEX_FL 0x00001000 /* hash-indexed directory */ |
| 192 | #define FS_IMAGIC_FL 0x00002000 /* AFS directory */ | 212 | #define FS_IMAGIC_FL 0x00002000 /* AFS directory */ |
| @@ -194,9 +214,12 @@ struct inodes_stat_t { · 1 unmodified line | |||
| 194 | #define FS_NOTAIL_FL 0x00008000 /* file tail should not be merged */ | 214 | #define FS_NOTAIL_FL 0x00008000 /* file tail should not be merged */ |
| 195 | #define FS_DIRSYNC_FL 0x00010000 /* dirsync behaviour (directories only) */ | 215 | #define FS_DIRSYNC_FL 0x00010000 /* dirsync behaviour (directories only) */ |
| 196 | #define FS_TOPDIR_FL 0x00020000 /* Top of directory hierarchies*/ | 216 | #define FS_TOPDIR_FL 0x00020000 /* Top of directory hierarchies*/ |
| 217 | #define FS_HUGE_FILE_FL 0x00040000 /* Reserved for ext4 */ | ||
| 197 | #define FS_EXTENT_FL 0x00080000 /* Extents */ | 218 | #define FS_EXTENT_FL 0x00080000 /* Extents */ |
| 198 | #define FS_DIRECTIO_FL 0x00100000 /* Use direct i/o */ | 219 | #define FS_EA_INODE_FL 0x00200000 /* Inode used for large EA */ |
| 220 | #define FS_EOFBLOCKS_FL 0x00400000 /* Reserved for ext4 */ | ||
| 199 | #define FS_NOCOW_FL 0x00800000 /* Do not cow file */ | 221 | #define FS_NOCOW_FL 0x00800000 /* Do not cow file */ |
| 222 | #define FS_INLINE_DATA_FL 0x10000000 /* Reserved for ext4 */ | ||
| 200 | #define FS_PROJINHERIT_FL 0x20000000 /* Create with parents projid */ | 223 | #define FS_PROJINHERIT_FL 0x20000000 /* Create with parents projid */ |
| 201 | #define FS_RESERVED_FL 0x80000000 /* reserved for ext2 lib */ | 224 | #define FS_RESERVED_FL 0x80000000 /* reserved for ext2 lib */ |
| 202 | 225 | ||