History of inode state bits
Linux 2.0.1:
/* nothing */
Linux 2.2.0:
/* Inode state bits.. */ #define I_DIRTY 1 #define I_LOCK 2 #define I_FREEING 4
Linux 2.3.47:
/* Inode state bits.. */ #define I_DIRTY 1 #define I_LOCK 2 #define I_FREEING 4 #define I_CLEAR 8
Linux 2.4.0-test12:
/* Inode state bits.. */ #define I_DIRTY_SYNC 1 /* Not dirty enough for O_DATASYNC */ #define I_DIRTY_DATASYNC 2 /* Data-related inode changes pending */ #define I_LOCK 4 #define I_FREEING 8 #define I_CLEAR 16
Splitting I_DIRTY_SYNC and I_DIRTY_DATASYNC allows fdatasync() to skip inodes that only have atime changed.
Linux 2.4.0-prerelease:
/* Inode state bits.. */ #define I_DIRTY_SYNC 1 /* Not dirty enough for O_DATASYNC */ #define I_DIRTY_DATASYNC 2 /* Data-related inode changes pending */ #define I_DIRTY_PAGES 4 /* Data-related inode changes pending */ #define I_LOCK 8 #define I_FREEING 16 #define I_CLEAR 32
I_DIRTY_PAGES allow filesystems to skip writing inodes if the inode itself was never changed, but only data pages.