History

fs: define inode flags using bit numbers

Define the VFS inode flags using bit numbers instead of hardcoding powers of 2, which has become unwieldy now that we're up to 65536. No change in the actual values.

Eric Biggers committed 6 years ago

Commit 6414e9b1 parent 79990961 file · +18 −18Browse files

Showing the changes to include/linux (1 of 1 file). Show all

Unified · Split

include/linux/fs.h+18−18
@@ -1982,27 +1982,27 @@ struct super_operations { · 1981 unmodified lines
1982/*1982/*
1983 * Inode flags - they have no relation to superblock flags now1983 * Inode flags - they have no relation to superblock flags now
1984 */1984 */
1985#define S_SYNC 1 /* Writes are synced at once */1985#define S_SYNC (1 << 0) /* Writes are synced at once */
1986#define S_NOATIME 2 /* Do not update access times */1986#define S_NOATIME (1 << 1) /* Do not update access times */
1987#define S_APPEND 4 /* Append-only file */1987#define S_APPEND (1 << 2) /* Append-only file */
1988#define S_IMMUTABLE 8 /* Immutable file */1988#define S_IMMUTABLE (1 << 3) /* Immutable file */
1989#define S_DEAD 16 /* removed, but still open directory */1989#define S_DEAD (1 << 4) /* removed, but still open directory */
1990#define S_NOQUOTA 32 /* Inode is not counted to quota */1990#define S_NOQUOTA (1 << 5) /* Inode is not counted to quota */
1991#define S_DIRSYNC 64 /* Directory modifications are synchronous */1991#define S_DIRSYNC (1 << 6) /* Directory modifications are synchronous */
1992#define S_NOCMTIME 128 /* Do not update file c/mtime */1992#define S_NOCMTIME (1 << 7) /* Do not update file c/mtime */
1993#define S_SWAPFILE 256 /* Do not truncate: swapon got its bmaps */1993#define S_SWAPFILE (1 << 8) /* Do not truncate: swapon got its bmaps */
1994#define S_PRIVATE 512 /* Inode is fs-internal */1994#define S_PRIVATE (1 << 9) /* Inode is fs-internal */
1995#define S_IMA 1024 /* Inode has an associated IMA struct */1995#define S_IMA (1 << 10) /* Inode has an associated IMA struct */
1996#define S_AUTOMOUNT 2048 /* Automount/referral quasi-directory */1996#define S_AUTOMOUNT (1 << 11) /* Automount/referral quasi-directory */
1997#define S_NOSEC 4096 /* no suid or xattr security attributes */1997#define S_NOSEC (1 << 12) /* no suid or xattr security attributes */
1998#ifdef CONFIG_FS_DAX1998#ifdef CONFIG_FS_DAX
1999#define S_DAX 8192 /* Direct Access, avoiding the page cache */1999#define S_DAX (1 << 13) /* Direct Access, avoiding the page cache */
2000#else2000#else
2001#define S_DAX 0 /* Make all the DAX code disappear */2001#define S_DAX 0 /* Make all the DAX code disappear */
2002#endif2002#endif
2003#define S_ENCRYPTED 16384 /* Encrypted file (using fs/crypto/) */2003#define S_ENCRYPTED (1 << 14) /* Encrypted file (using fs/crypto/) */
2004#define S_CASEFOLD 32768 /* Casefolded file */2004#define S_CASEFOLD (1 << 15) /* Casefolded file */
2005#define S_VERITY 65536 /* Verity file (using fs/verity/) */2005#define S_VERITY (1 << 16) /* Verity file (using fs/verity/) */
2006 2006
2007/*2007/*
2008 * Note that nosuid etc flags are inode-specific: setting some file-system2008 * Note that nosuid etc flags are inode-specific: setting some file-system

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t