DAX effective mode (S_DAX) changes requires inode eviction. XFS has an advisory flag (XFS_IDONTCACHE) to prevent caching of the inode if no other additional references are taken. We lift this flag to the VFS layer and change the behavior slightly by allowing the flag to remain even if multiple references are taken. This will expedite the eviction of inodes to change S_DAX.
Showing the changes to include/linux (1 of 4 files). Show all
Unified · Split
| @@ -2156,6 +2156,8 @@ static inline void kiocb_clone(struct kiocb *kiocb, struct kiocb *kiocb_src, · 2155 unmodified lines | ||
| 2156 | 2156 | * |
| 2157 | 2157 | * I_CREATING New object's inode in the middle of setting up. |
| 2158 | 2158 | * |
| 2159 | + * I_DONTCACHE Evict inode as soon as it is not used anymore. | |
| 2160 | + * | |
| 2159 | 2161 | * Q: What is the difference between I_WILL_FREE and I_FREEING? |
| 2160 | 2162 | */ |
| 2161 | 2163 | #define I_DIRTY_SYNC (1 << 0) |
| @@ -2178,6 +2180,7 @@ static inline void kiocb_clone(struct kiocb *kiocb, struct kiocb *kiocb_src, · 16 unmodified lines | ||
| 2178 | 2180 | #define I_WB_SWITCH (1 << 13) |
| 2179 | 2181 | #define I_OVL_INUSE (1 << 14) |
| 2180 | 2182 | #define I_CREATING (1 << 15) |
| 2183 | +#define I_DONTCACHE (1 << 16) | |
| 2181 | 2184 | |
| 2182 | 2185 | #define I_DIRTY_INODE (I_DIRTY_SYNC | I_DIRTY_DATASYNC) |
| 2183 | 2186 | #define I_DIRTY (I_DIRTY_INODE | I_DIRTY_PAGES) |
| @@ -3049,7 +3052,8 @@ extern int inode_needs_sync(struct inode *inode); · 865 unmodified lines | ||
| 3049 | 3052 | extern int generic_delete_inode(struct inode *inode); |
| 3050 | 3053 | static inline int generic_drop_inode(struct inode *inode) |
| 3051 | 3054 | { |
| 3052 | − return !inode->i_nlink || inode_unhashed(inode); | |
| 3055 | + return !inode->i_nlink || inode_unhashed(inode) || | |
| 3056 | + (inode->i_state & I_DONTCACHE); | |
| 3053 | 3057 | } |
| 3054 | 3058 | |
| 3055 | 3059 | extern struct inode *ilookup5_nowait(struct super_block *sb, |