History

fs: Remove FS_THP_SUPPORT

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.

Matthew Wilcox (Oracle) committed 5 years ago

Commit ff36da61 parent a1efe484 files · +18 −4Browse files

Unified · Split

4 files
  1. fs/inode.c +0 −2
  2. include/linux/fs.h +0 −1
  3. include/linux/pagemap.h +16 −0
  4. mm/shmem.c +2 −1
fs/inode.c+0−2
@@ -180,8 +180,6 @@ int inode_init_always(struct super_block *sb, struct inode *inode) · 179 unmodified lines
180180 mapping->a_ops = &empty_aops;
181181 mapping->host = inode;
182182 mapping->flags = 0;
183− if (sb->s_type->fs_flags & FS_THP_SUPPORT)
184− __set_bit(AS_THP_SUPPORT, &mapping->flags);
185183 mapping->wb_err = 0;
186184 atomic_set(&mapping->i_mmap_writable, 0);
187185 #ifdef CONFIG_READ_ONLY_THP_FOR_FS
include/linux/fs.h+0−1
@@ -2518,7 +2518,6 @@ struct file_system_type { · 2517 unmodified lines
25182518 #define FS_USERNS_MOUNT 8 /* Can be mounted by userns root */
25192519 #define FS_DISALLOW_NOTIFY_PERM 16 /* Disable fanotify permission events */
25202520 #define FS_ALLOW_IDMAP 32 /* FS has been updated to handle vfs idmappings. */
2521−#define FS_THP_SUPPORT 8192 /* Remove once all fs converted */
25222521 #define FS_RENAME_DOES_D_MOVE 32768 /* FS will handle d_move() during rename() internally. */
25232522 int (*init_fs_context)(struct fs_context *);
25242523 const struct fs_parameter_spec *parameters;
include/linux/pagemap.h+16−0
@@ -176,6 +176,22 @@ static inline void mapping_set_gfp_mask(struct address_space *m, gfp_t mask) · 175 unmodified lines
176176 m->gfp_mask = mask;
177177 }
178178
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+
179195 static inline bool mapping_thp_support(struct address_space *mapping)
180196 {
181197 return test_bit(AS_THP_SUPPORT, &mapping->flags);
mm/shmem.c+2−1
@@ -2303,6 +2303,7 @@ static struct inode *shmem_get_inode(struct super_block *sb, const struct inode · 2302 unmodified lines
23032303 INIT_LIST_HEAD(&info->swaplist);
23042304 simple_xattrs_init(&info->xattrs);
23052305 cache_no_acl(inode);
2306+ mapping_set_large_folios(inode->i_mapping);
23062307
23072308 switch (mode & S_IFMT) {
23082309 default:
@@ -3870,7 +3871,7 @@ static struct file_system_type shmem_fs_type = { · 1561 unmodified lines
38703871 .parameters = shmem_fs_parameters,
38713872 #endif
38723873 .kill_sb = kill_litter_super,
3873− .fs_flags = FS_USERNS_MOUNT | FS_THP_SUPPORT,
3874+ .fs_flags = FS_USERNS_MOUNT,
38743875 };
38753876
38763877 int __init shmem_init(void)

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