History

fanotify: implement "evictable" inode marks

When an inode mark is created with flag FAN_MARK_EVICTABLE, it will not pin the marked inode to inode cache, so when inode is evicted from cache due to memory pressure, the mark will be lost. When an inode mark with flag FAN_MARK_EVICATBLE is updated without using this flag, the marked inode is pinned to inode cache. When an inode mark is updated with flag FAN_MARK_EVICTABLE but an existing mark already has the inode pinned, the mark update fails with error EEXIST. Evictable inode marks can be used to setup inode marks with ignored mask to suppress events from uninteresting files or directories in a lazy manner, upon receiving the first event, without having to iterate all the uninteresting files or directories before hand. The evictbale inode mark feature allows performing this lazy marks setup without exhausting the system memory with pinned inodes. This change does not enable the feature yet.

Amir Goldstein committed 4 years ago

Commit 7d5e0051 parent 8998d113 files · +39 −2Browse files

Showing the changes to include/uapi (1 of 3 files). Show all

Unified · Split

include/uapi/linux/fanotify.h+1−0
@@ -82,6 +82,7 @@ · 81 unmodified lines
82#define FAN_MARK_IGNORED_SURV_MODIFY 0x0000004082#define FAN_MARK_IGNORED_SURV_MODIFY 0x00000040
83#define FAN_MARK_FLUSH 0x0000008083#define FAN_MARK_FLUSH 0x00000080
84/* FAN_MARK_FILESYSTEM is 0x00000100 */84/* FAN_MARK_FILESYSTEM is 0x00000100 */
85#define FAN_MARK_EVICTABLE 0x00000200
85 86
86/* These are NOT bitwise flags. Both bits can be used togther. */87/* These are NOT bitwise flags. Both bits can be used togther. */
87#define FAN_MARK_INODE 0x0000000088#define FAN_MARK_INODE 0x00000000