Instead of setting a bit in the fs_flags to set a bit in the address_space, set the bit in the address_space directly.
Showing the changes to include (2 of 4 files). Show all
Unified · Split
| @@ -2518,7 +2518,6 @@ struct file_system_type { · 2517 unmodified lines | ||
| 2518 | 2518 | #define FS_USERNS_MOUNT 8 /* Can be mounted by userns root */ |
| 2519 | 2519 | #define FS_DISALLOW_NOTIFY_PERM 16 /* Disable fanotify permission events */ |
| 2520 | 2520 | #define FS_ALLOW_IDMAP 32 /* FS has been updated to handle vfs idmappings. */ |
| 2521 | −#define FS_THP_SUPPORT 8192 /* Remove once all fs converted */ | |
| 2522 | 2521 | #define FS_RENAME_DOES_D_MOVE 32768 /* FS will handle d_move() during rename() internally. */ |
| 2523 | 2522 | int (*init_fs_context)(struct fs_context *); |
| 2524 | 2523 | const struct fs_parameter_spec *parameters; |
| @@ -176,6 +176,22 @@ static inline void mapping_set_gfp_mask(struct address_space *m, gfp_t mask) · 175 unmodified lines | ||
| 176 | 176 | m->gfp_mask = mask; |
| 177 | 177 | } |
| 178 | 178 | |
| 179 | +/** | |
| 180 | + * mapping_set_large_folios() - Indicate the file supports large folios. | |
| 181 | + * @mapping: The file. | |
| 182 | + * | |
| 183 | + * The filesystem should call this function in its inode constructor to | |
| 184 | + * indicate that the VFS can use large folios to cache the contents of | |
| 185 | + * the file. | |
| 186 | + * | |
| 187 | + * Context: This should not be called while the inode is active as it | |
| 188 | + * is non-atomic. | |
| 189 | + */ | |
| 190 | +static inline void mapping_set_large_folios(struct address_space *mapping) | |
| 191 | +{ | |
| 192 | + __set_bit(AS_THP_SUPPORT, &mapping->flags); | |
| 193 | +} | |
| 194 | + | |
| 179 | 195 | static inline bool mapping_thp_support(struct address_space *mapping) |
| 180 | 196 | { |
| 181 | 197 | return test_bit(AS_THP_SUPPORT, &mapping->flags); |